A Cheap(Free) Backup Tool
March 21st, 2007[ Geek ]
I handle my main backups the old fashioned way. I have a script I run periodically which creates a date based folder. I then zip up specific areas of files and move them over to that date based folder. I also make sure that only admin has rights to the backup area so I can’t damage it in course of daily work.
I keep this file in my home directory but create a symbolic link in /usr/bin so that I can run it anytime by issing:
Yes I also run a raid-1 array and keep almost all my files in svn but it doesn’t hurt to be cautious. It’s really simple and I’m sure interests no one but in case, here’s what it looks like. Oh, and to add other directories to be backed up, you just copy that last section and change the “personal” to the other directory name you want to backup. Each section is put into it’s own backup file.
# Specify the base backup dir where all the backups live.
baseDir=”/backup/”
# Create backup directory based on date.
# This is based on the baseDir set above.
# Example: Feb 14, 2005 would be 20050214
backupDir=$baseDir$(date +%F)
echo “Creating backup dir $backupDir”
mkdir $backupDir
# Specify the base dir where all the files to be backed up live.
# All subsequent directories are built relative to this.
baseSrcDir=”/home/brydon”
# personal dir
srcDir=”personal”
dir=”$baseSrcDir/$srcDir”
echo “backing up dir ‘$dir’…”
tar cfj $backupDir/$srcDir.tar.bz2 $dir