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

Advertisement

cerkaz
Joined:
Posts:
1

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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,587
Location:
Prague, Czechia

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

Reply with quote

Advertisement

You can post new topics in this forum