option batch abortNow this is the first part for local, so downloading everything new on the server to the local directory, next we have to put either in same file between the synchronize command and exit or I tried in new file example2.txt:
option confirm off
open ftp://username:password@ftphost
synchronize local c:\local\path /path/on/server
exit
option batch abortNote: If you need it to be SFTP instead of ftp:/ simply take that part out to look like this: open username2:password2@ftphost2
option confirm off
open ftp://username2:password2@ftphost2
synchronize remote c:\local\path /path/on/server2
exit
Getting the same thing to a secondary server with different username and pass of course, this means we are replicating not only locally but also on a second server (for maximum redundant and backup if you have an important application like I do).
And for automation purpose I have a script called ftp.bat with following:
"progs\WinSCP.exe" /script=c:\path\to\example.txt /log=c:\path\to\logs\sftplog.txt
"progs\WinSCP.exe" /script=c:\path\to\example2.txt /log=c:\path\to\logs\sftplog.txt
Finally it's pretty easy to create a scheduled task (instructions will be coming soon if there's demand for this, leave a comment below) simply to point to ftp.bat and start it daily when you wish to do it!
Leave any feedback please
4 comments:
This was most helpful. Thank you!
Thanks a Million. Very Helpful.
THANK YOU! This worked great.
Still relevant - thanks.
Post a Comment