There should be a systematic, programmatic and scheduled backup of files on all Desktops where I work. However, one is not currently in place and given manning and resources, or lack there of, it is unlikely this will be instituted. Thus I devised a method to backup my files to the N: drive and synchronize them on a scheduled basis. I will describe what I'm doing, how I'm doing it and how you can do it below. I caviat all of this with I'm not responsible for your files or what happens to them – caveat emptor.
Backing up your critical files on your Windows Vista/7 should be a seamless and automatic process. To facilitate these criteria I have linked two tools together: Python and the Windows Vista Task Scheduler. I will discuss each in their own section.
The steps you will need to take to get this working for you are:
Having some minimal experience in Unix I know of a tool for backing up and synchronizing files called rsync. Duplicating this capability with Python on Windows would require more time than I have and I did not find a relatively simple and understandable solution on the internet. I did find a small script for copying and synchronizing files called pyrobocopy.py. The full description and details are at: http://code.activestate.com/recipes/231501-python-robocopier-advanced-directory-synchronizati/. Verifying and using this approximately 500 line program was relatively easy and I decided to use it with Windows Task Scheduler to implement my process. From the pyrobocopy source code the usage is:
Usage: %s <sourcedir> <targetdir> Options Main Options:\n -d --diff - Only report difference between sourcedir and targetdir -s, --synchronize - Synchronize content between sourcedir and targetdir -u, --update - Update existing content between sourcedir and targetdir Additional Options:\n -p, --purge - Purge files when synchronizing (does not purge by default). -f, --force - Force copying of files, by trying to change file permissions. -n, --nodirection - Update files in source directory from target directory (only updates target from source by default). -c, --create - Create target directory if it does not exist (By default, target directory should exist.) -m, --modtime - Only compare file's modification times for an update (By default, compares source file's creation time also).
For my simple use I've only invoked the update and synchronize options. My first step was to copy the file structure and files I wanted; then I used the update function. I did this before setting up a task schedule.
The full use of the Windows Task Scheduler is beyond the scope of this document. Below are two links to web sites that provide short “tutorials” on how to use the Task Scheduler.
Once you are familiar with the Task Scheduler there are a couple of tricks and gotchas I've found: