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

Anonymous wrote:

1. Can I use a command to delete the file which is more than 7 days old every time it syncs? Or, alternatively, can it automatically delete older files if there are more than 6 existing in the remote directory?

Not easily.
This example may give you home hint:
https://winscp.net/eng/docs/script_download_most_recent_file
Also your task becomes way easier once WinSCP .NET assembly is released (in about week time):
https://winscp.net/eng/docs/library

2. Can I write a command which will send a success/failed email every night so I know the status of the file sync?

See documentation:
https://winscp.net/eng/docs/script_email
Guest

I have fixed the script. The following line does exactly what I want it to do:

winscp.com /command "option batch abort" "option confirm off" "open "Test_Backup"" "synchronize remote C:\Test\ /Test/" "exit"


I do have two features which I would like to add to this script if possible. The script will be running every night and it will be uploading a single zip file. I would like it to only keep one weeks worth of zip files in the remote folder. I would also like it to e-mail me a confirmation that the zip file was synched to the remote folder without error.

1. Can I use a command to delete the file which is more than 7 days old every time it syncs? Or, alternatively, can it automatically delete older files if there are more than 6 existing in the remote directory?
2. Can I write a command which will send a success/failed email every night so I know the status of the file sync?
Guest

I have now got most of the script working. I created a log file of the script and it gets to the synchronize line then fails.

winscp.com /command "option batch abort" "option confirm off" "open "Test_Backup"" "synchronize -remote C:\Test\ /test/" "exit"


Any help would be greatly appreciated!
Guest

I guess I should have mentioned that I am putting that code line in the Task Scheduler Arguments.
Guest

Automation Script Not Working!

I have tried everything to get this script to work. Not sure where I am going wrong. As far as I can tell from all of the stuff I have read, the script should look like this:

winscp.com /command "option batch abort" "option confirm off" "session Test_Backup" "synchronize \Test\test.zip /test/" "exit"


I have created and tested a session in WINSCP called Test_Backup. All pathes exist locally and on the remote server. The server is using SSL Explicit encryption, I do know the key, user name and password. The connection can be made manually and works fine. Not sure where I am going wrong here?

Thanks!