With 3 easy steps, using WinSCP and SmartFile, you can sync important folders and files from a Windows 2008 Server to SmartFile. Using task scheduler, this can be automated on a nightly basis with a log file that’s generated each evening.

This is useful for a number of obvious reasons, like logging, file backup and compliance.

1) Download WinSCP

You can download WinSCP here.

2) Create a winscp_sync.txt file

Add the following information to a file named winscp_sync.txt (ssh-keys can be used instead of username:password).

    Here’s what you need to know about this file and its contents:

  • username:password – Your SmartFile username and password
  • source_path – File and folders to be backed-up to SmartFile
  • /destination_path – Folder path on SmartFile system to place files and folders

3) Add a new scheduled task in Windows

Next we’re going to create a new schedule task. You’ll use the following settings:

  1. Under Create a new action, select “Start a program”
  2. Under Program/script, enter: cmd
  3. Under Add arguments (optional), enter: /c start "" path_to_winscp.exe /console /script=path_to_winscp_sync.txt /log=path_to_winscp_logs\%date:~10,4%%date:~4,2%%date:~7,2%.txt /loglevel=0
windows server 2008

Click to Enlarge

    Here’s what you need to know about the scheduled task:

  • path_to_winscp.exe – Path to WinSCP.exe file
  • path_to_winscp_sync.txt – Path to winscp_sync.txt file created above
  • path_to_winscp_logs – Path to folder where to store daily logs
  • After the start command – The empty double quote is required

This task will open a console, that then starts WinSCP.exe. Doing it this way allows us to set the date variable for the log file names.

Once this task is created, manually run it to test that all files and folders get uploaded from the source location to the destination location. Any files added or removed in the source will be reflected in the destination path. The logging provides a significant amount of info for troubleshooting.

Other Notes –
1) Be sure to set the job to “run whether user is logged on or not”.
2) Items deleted locally will be deleted remotely, remove the -delete option to NOT remove the remote items.

Need a Way to Sync Files From Your Windows Server?
Give SmartFile a Try!

Click Here to Try It Free

Related Posts

About Chris Sheaves

I am the VP of Products at SmartFile. I'm tasked with managing and overseeing the evolution of SmartFile's products and solutions. I'm great at listening to our customers and translating their wants and needs to our engineers. I also oversee all IT operations and infrastructure.

Leave a Reply

Your email address will not be published. Required fields are marked *