Topic "Automation Script Not Working!"

Author Message
Guest




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:

Code:
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!
Advertisements
Guest




I guess I should have mentioned that I am putting that code line in the Task Scheduler Arguments.
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.

Code:
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 have fixed the script. The following line does exactly what I want it to do:

Code:
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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
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

Quote:
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/guide_automation#results
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License