|
UnixReview.com
June 2005
Shell Corner: DVD-RAM Daily Backup
Hosted by Ed Schaefer
This month, Louis Poehlitz shares a Perl script, daily-back,
which he uses to back up his home network to DVD.
DVD-RAM Daily Backup
by Louis Poehlitz
After installing a home network, I felt guilty not backing up my home network
files very often. Losing those precious pictures of the kids to a hard drive
crash would not be good. So, I developed a Perl script — daily-back —
which writes backups to a DVD-RAM disk.
DVD-RAM disks have about the right capacity because my home files are only
a gigabyte or two and the media is rewriteable, which keeps long-term costs
down. I selected a DVD-RAM drive that takes DVD-RAM media in a cartridge because
a cartridge provides dust and scratch protection.
Key Decisions
Writing the script in Perl seemed obvious as I am always looking to expand
my Perl skills. I researched some of the common backup programs and picked gtar
because it has a verify feature and a "-newer" switch so that I could create
incremental backups. The verify feature of gtar causes the written backup to
be verified against the source, which is important when writing to a backup
medium like DVD-RAM (which may develop bad blocks over time). Although I would
have liked to have used a portable cross-OS filesystem, on the Linux version
I was running, the Linux native ext2 filesystem worked well out of the box.
Running the Script — Command-Line Options
Daily-back, a simple backup
program, takes one command-line option that indicates the function to be performed
or the operating mode:
daily-back -incr
daily-back -full
The first iteration of the script featured only two command-line options:
"-full" for full backup, and "-incr" for incremental backup.
|