I always confess my love of Linux. All I need is some rsync and ssh and there’s nothing I can’t do.
My wife runs Windows 7 and maintains our finances, so backups are important. I tried all the normal stuff like Robocopy and SyncToy, but both would do strange things when added to Taskscheduler.
I’m sure they work fine and I might have neglected to check the box for “Wake up computer to perform this task” and the other box for “only run tasks if this network connection is active“, but, hey, I’m not a Windows guy and only now noticed those check boxes while typing this post.
So I created some directories
# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect, this must be setup in WinSCP as a saved session and have password saved
# Change remote directory where your folder is.
# My folder is /RAID/pub/User_Files/John
# Force binary mode transfer
option transfer binary
# Download file to the local directory
# get archives/* f:backupsarchives*
# Delete downloaded files
# rm archives/*
# The line below would sync from remote to local
# synchronize local f:backupsarchives archives
# syncing local to remote while deleting removed files
synchronize remote -delete c:John John
# Exit WinSCP
Then I used this command in Task-scheduler:
c:”Program Files (86)”WinSCPWinSCP.exe /console /script=c:syncscriptssync.txt /log=c:synclogswinscp.txt
Actually it I selected “Run Program” then browsed to c:”Program Files (86)”WinSCPWinSCP.exe, Then in the arguments box I added /console /script=c:syncscriptssync.txt /log=c:synclogswinscp.txt
Also keep in mind to check the boxes for “Wake up computer to perform this task” and the other box for “only run tasks if this network connection is active” (while selecting your active wifi or network link)
Was this helpful?
If you found my posts interesting, or I helped you figure something out, please consider tossing me a tiny gratuity for my time, research, to help offset the web hosting/development costs or to buy me a cup of coffee.
* This post may contain affiliate links. This means that I “might” receive a tiny amount of money, if you make a purchase using one of our links. It does not cost you anything extra, and helps us defray the costs of hosting and maintaining this site.