Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: How to use custom commands to zip files on task scheduler export job

WinSCP cannot zip files.
You have to zip them before starting WinSCP.
If you currently start WinSCP directly in the Task Scheduler, you will have to wrap WinSCP call to a batch file (or PowerShell script or any another script of your preference). And within the batch/script, run zip before starting WinSCP.

For an example of a wrapper batch file, see:
https://winscp.net/eng/docs/guide_debugging_scheduler#output
cerkaz

How to use custom commands to zip files on task scheduler export job

I've been using following line from https://winscp.net/eng/docs/guide_schedule to export csv files to our FTP.
/log=c:\path\winscp.log /command "open sftp://user:password@example.com/" "put -delete d:\*.csv /home/user/" "exit"


It works fine, but due to the big size of the csv i would like to zip them.
I read that
zip -r "!?&Enter an Archive Name:?archive.zip!" !&
could be used, can i implement that to the task scedule line?