Wednesday, June 22, 2016

How to backup automatically a file to a network

Just create a batch file with the following command:

robocopy source destination /xo /purge /e

Example for source would be: C:\desktop\myfolder
Example for destination would be: T:\backup\myfolder

The files deleted in the source will be deleted in the destination and just the files changed will be copied to the destination (high performance).

/E : Copy Subfolders, including Empty Subfolders.
/XO : eXclude Older - if destination file exists and is the same date or newer than the source - don't bother to overwrite it.
/PURGE :: delete dest files/dirs that no longer exist in source.