I use WinSCP script, it's triggered using Windows task Scheduler. Open the connection you will be using with WinSCP and then on tabs menu select Generate session URL/Code and switch to script tab in dialog box.
Just add a command.
That one syncs remote directory to local directory. Note the -delete option, that will remove files in local directory that no longer exist on server. From there just set up scheduled task using the line after
I take one more step copying new files to external dirive thus if for some reason files go corrupt on server and they get synced to local folder I still have good copies.
Code:
open sftp://root@..blah,blah,blah..... this is auto generated connection information. # Your command 1# Your command 2exit# Execute the script using a command like:# "C:\Program Files (x86)\WinSCP\WinSCP.exe" /log="C:\writable\path\to\log\WinSCP.log" /ini=nul /script="C:\path\to\script\script.txt"
Code:
synchronize local -delete C:\path\to\local\backup\directory /full/path/to/remote/directory
# Execute the script using a command like:
I take one more step copying new files to external dirive thus if for some reason files go corrupt on server and they get synced to local folder I still have good copies.
Statistics: Posted by thecoalman — Thu Jun 19, 2025 4:32 am