DoBackup.txt (manual):
DoBackup
========
2009-11-03
1.1.0
Introduction
============
DoBackup is a script to perform simple backup with. It's really not much to it, it relies on a couple of other programs to do the actual work.
There are two ways of using it (well, there are more but two intended ones):
1) Put it on a removable drive and make it run automatically on each computer the drive is attached to, when it is attached.
2) Schedule it for regular backup using Task Scheduler
Since there are many backup programs out there that performs their job based on a schedule, this script is mainly intended for the no 1) use and that's what's covered here. To add the script to the Task Scheduler is considered an excercise for the reader
Prerequisities
==============
1) Robocopy for backup (included in Vista and Windows 7)
2) WinRAR for compression of log files
Setting up backup on a removable drive
======================================
1) Copy DoBackup.bat to the root of the USB drive
2) For each computer that should be backed up, place an empty text file in c:\ called "DoBackup-Sources.txt"
3) Edit this/those textfile(s) to include directories to be backed up according to the following rules:
a) Full path (including drive) to directory to back up, enclosed in "" if it contains white spaces.
b) A semicolon (;)
c) The name of the backup directory as it should appear on backup drive
d) A newline
e) NO spaces may occur, except for the those that might appear in the path as described in a.
f) Repeat a-e for each directory that should be backed up on the computer
4) Run DoBackup.bat from the drive to perform a backup
5) Make sure backup is completed ("Press any key to continue" prompted) before doing anything. If not, files may be lost!
6) Do a "safely remove hardware" on the USB drive to ensure data is saved before removing drive. If not, files may be lost!
Make the script run automatically when drive is inserted
========================================================
1) Copy Autorun.inf and DoBackup.ico to the root of the USB drive
2) For each drive that should be backed up, simply insert drive and choose DoBackup when prompted.
How it works
============
It simply copies all directories in the specified file in the root of c:\ on the system the script is run from, to the same drive the script is located on (USB drive if used as intended)
Backups are placed in one folder, logs of all activities are stored in another, compressed. Those locations are relative to the script. See the script for further details. If no compression program is available, the logs are kept as is.
So why use it instead of using robocopy directly? Well, it provides some logging and it takes care of all switches to robocopy. It's supposed to ease things up, if not maybe it's not for you.
History
=======
* 2009-11-03:
- Added documentation
- Some error handling
* 2009-08-30:
- Added /mir flag to mirror files
- Added compression of log files
- Added support for multiple backups during one day (backup log files from same day will not be overwritten, new, unique ones, are created if needed)
* 2009-06-16:
- Initial version