[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Backup Idea Correction



Mike Fritsch <mfritsch@xxxxxxxxxxxx> wrote:
> tar cvfW /home/etc.tar .
> tar cvfW /home/var.tar .
> tar cvfW /home/usr-admserv.tar .
> tar cvfW /home/usr-local.tar  .

You forgot the site files and user directories.  Here are a few things I backup that
you missed (you may have important files elsewhere too).

/home/log/httpd/ # httpd log files
/home/spool/ # user mail spools and crontab spools
/root/ # root's user directory
/home/sites/ # site files and user files

You also may want to consider automating the backup.  Here's a short script to backup
some files onto the local hard drive.

#!/bin/sh
backup_dir="/home/mybackups/daily"
tar -cpvz -f $backup_dir/backup.sites_1-9-`date +%Y-%m-%d`.tar.gz
/home/sites/site[1-9]/
tar -cpvz -f $backup_dir/backup.sites_10-19-`date +%Y-%m-%d`.tar.gz
/home/sites/site1?/
ls -aRl --full-time / > /home/ref/file_list.txt
tar -cpvz -f $backup_dir/backup.file_list-`date +%Y-%m-%d`.tar.gz
/home/ref/file_list.txt

The -z option in tar uses gzip compression - takes 2-3 times as long, but takes up a
1/3 of the space.  I like to backup my sites in groups of 10.  The first 2 tar
commands create two backup files for the first 20 sites.  The following two create
and backup a text file of the server's file structure - good for comparing to a past
snapshot.

Steven Werby {steven-lists@xxxxxxxxxxxx}