Jameser's Tech Tips

Tuesday, August 22, 2006

Tip #39: Backing Up to DVD Using Free Tools in Windows XP

Today's tip is on backing up a directory or drive to recordable DVD media using free tools. The approach we'll be using will also allow you to span multiple DVDs for larger backup jobs.

The first tool we'll be using is DAR (DiskArchive), which was originally developed as a Linux command line application, but has also been ported to the Windows environment. DAR allows you to create archives of directory structures, while splitting the archive file into multiple files of a user defined size.

The second tool we'll be using is called CommandBurner. CommandBurner is a Win32 utility that can burn files or directories from the Windows Command Prompt.

DAR can be downloaded from here, and CommandBurner can be downloaded from here.

DAR allows you to execute an external application after the creation of each slice of an archive. We'll be taking advantage of this feature, by calling upon CommandBurner to burn each newly created slice.

After you have downloaded and installed both DAR and CommandBurner, you can back up specific directories using the following syntax:
(this should all be entered on a single line)

c:\path_to_dar\dar -c "/cygdrive/T/ArchiveName" -s 4000M -p -b -v -R "/cygdrive/c/DirToBackup" -E "/cygdrive/c/Progra~1/Comman~1/CmdBurn.exe burn /f T:\\%b.%n.%e /l %b.%n /hide /eject; rm -f T:\\%b.%n.%e"

In the above example, you'll need to change the T in "/cygdrive/T/ArchiveName", "T:\\%b.%n.%e" ,and "rm -f T:\\..." to a drive letter where you have space for creating a temporary 4GB file. Also, change "/cygdrive/c/DirToBackup" to the drive and directory you'd like to backup. Notice that DAR requires cygwin style paths, while CmdBurn uses the conventional Windows format.

This single command will create 4GB slices of the directory you specify and then directly burn to DVD, opening the tray for new media after each is burnt. Each DVD will be labeled with the ArchiveName and the number of the backup set, (i.e. ArchiveName.1). The file on the disc will be named the same, but also have the .dar extension.

To view the files contained within your backup set, use the following command:

dar -l /cygdrive/x/ArchiveName

Replace the x above with the drive letter of your DVD drive. If the archive is part of a multidisc set, you'll be prompted for additional discs.

To restore all of the files from the archive, use the command below:

dar -x /cygdrive/x/ArchiveName -R /cygdrive/c/DirToRestoreTo

Replace the x with your DVD drive, and also alter where you'd like to have the files restored to.

For additional information on the many features DAR has available, including compression and encryption, you can consult the documentation available at the DAR site.

If you have any questions on today's tip, please leave a comment.


Post a Comment

<< Home