File Backup on the Cheap (well, free)
So I am paranoid about losing my data to hard drive failure but not really interested in spending money on backup solutions nor do I want any backup agents running all the time.
Since I have two physical hard drives, I want to replicate my important data on them. That way the failure of either of the physical drives will not result in complete loss. I don't need this to be real-time backup, just a periodic snapshot of my worked-on documents, pictures, etc.
Here's a BAT file I wrote for my Windows XP system, I assume this will work on any version of Windows that you're likely to have.
This script lives on my desktop. I execute it once in a while (especially after I downloaded new pictures from the cam or have new documents.)
The script is very simple. I list the locations (whether the directories or files) that I want to backup in the stuff_to_backup variable. The destination is specified as the argument to the xcopy command (D:\Documents and Pictures Backup in my case)
When the script is done, the destination directory will contain a copy of all the source directories or files, including any subdirectories. The subsequent runs will only copy files that have been added or changed since the previous backup. The script runs rather quickly since it only has to copy a few files on most runs.
cls @echo off set stuff_to_backup=F:\Documents F:\Pictures F:\Outlook_archive.rar F:\Outlook_main.pst rem /D = all newer than desination time rem /E = copy subdirs incl. empty ones rem /V = verify each file rem /I = assume destination is a directory rem /Y = surpress prompting on override set xcopy_options=/D /E /V /I /Y for %%A IN (%stuff_to_backup%) ^ DO ( echo %%A: xcopy %%A "D:\Documents and Pictures Backup\%%~nA" %xcopy_options% ) rem %%~nA ... the ~n returns just the file name. So when %%A is F:\Outlook_archive.rar, %%~nA is Outlook_archive rem make the window not dissapear till keypress when run from Explorer pause