DirSync Utility

This is a little utility that I wrote for backing up a source directory into a target directory. It copies all the files from the source directory to the target directory. If the target file exist, then the two files are compared and if the source file is newer then it is copied to the target directory. It does not copy files from the target directory to the source directory. This could be added if it is needed, but at this point I do not require that function. There are three switches for the executable, they are -s for source directory, -t for target directory and -r for retention days. After comparing the source and target directories, the program will scan the target directory and delete any file that has not been modified for more than the retention days. The best way to describe a use for this would be in the case of a SQL server. We create one full backup each morning and then backup the transaction logs every 15 minutes during the day. The full backup of our ERP is 6 gigs. The server that is hosting the SQL server only has 130 gigs of storage so we can not keep more than two days for backup files on the server before we start to have storage problems. We do have a file server with 800 gigs of storage so I am using this program to copy the backup files from the SQL server to the file server and only keep two days on the SQL server. I can then set the retention days to seven and it will keep seven days worth of backups on the file server.

The utility is called like:
sync.exe -sc:sql backups -t\computer1c$temp -r14

The source can be downloaded here and the executable can be downloaded here.

Leave a Reply

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