|
Here is a copy of the original script
--
site link
-------------------------------------------------------------------
Cut Here ------------------------------------------
#!/bin/bash
#
# creates backups of essential files
# rv: oct. 6, 2000 : changed "find -atime +1" to "find
-ctime +1"
# rv: oct. 8, 2000 : fixed incorrect use of find for incremenal
backups
# find -ctime -1 iso find -ctime +1
# (thanks to Gysbert Rochat)
#
DATA="/home /root /usr/local/httpd"
CONFIG="/etc /var/lib /var/named"
LIST="/tmp/backlist_$$.txt"
#
mount /mnt/backup
set $(date)
#
if test "$1" = "Sun" ; then
# weekly a full backup of all data and config. settings:
#
tar cfz "/mnt/backup/data/data_full_$6-$2-$3.tgz" $DATA
rm -f /mnt/backup/data/data_diff*
#
tar cfz "/mnt/backup/config/config_full_$6-$2-$3.tgz"
$CONFIG
rm -f /mnt/backup/config/config_diff*
else
# incremental backup:
#
find $DATA -depth -type f -ctime -1 -print > $LIST
tar cfzT "/mnt/backup/data/data_diff_$6-$2-$3.tgz" "$LIST"
rm -f "$LIST"
#
find $CONFIG -depth -type f -ctime -1 -print > $LIST
tar cfzT "/mnt/backup/config/config_diff_$6-$2-$3.tgz"
"$LIST"
rm -f "$LIST"
fi
#
# create sql dump of databases:
mysqldump -u root --password=mypass --opt mydb >
"/mnt/backup/database/mydb_$6-$2-$3.sql"
gzip "/mnt/backup/database/mydb_$6-$2-$3.sql"
#
umount /mnt/backup
-------------------------------------------------------------------
Cut Here ------------------------------------------
Added support for Tape Backup and NFS. This configuration will allow
me to copy all the complete backups to a tape drive so I can take
offsite.
-------------------------------------------------------------------
Cut Here ------------------------------------------
#!/bin/bash
set
$(date)
mt
-f /dev/nst0 load
mt -f /dev/nst0 rewind
mt -f /dev/nst0 erase
mt -f /dev/nst0 retension
mount
10.0.0.11:/mnt /pegasus
mount /dev/sdb1 /mnt
tar
-czf /dev/nst0 /mnt/users
tar -czf /dev/nst0 /mnt/warranty
tar -czf /dev/nst0 /mnt/web
tar -czf /dev/nst0 /mnt/access
tar -czf /dev/nst0 /pegasus/config
tar -czf /dev/nst0 /pegasus/data
umount
/dev/sdb1
umount /pegasus
mt
-f /dev/nst0 rewind
mt -f /dev/nst0 retension
tar -ztf /dev/nst0 >> /backup/list/list-tape_$6-$2-$3
tar -ztf /dev/nst0 >> /backup/list/list-tape_$6-$2-$3
tar -ztf /dev/nst0 >> /backup/list/list-tape_$6-$2-$3
tar -ztf /dev/nst0 >> /backup/list/list-tape_$6-$2-$3
tar -ztf /dev/nst0 >> /backup/list/list-tape_$6-$2-$3
tar -ztf /dev/nst0 >> /backup/list/list-tape_$6-$2-$3
mt
-f /dev/nst0 offline
-------------------------------------------------------------------
Cut Here -------------------------------------------
Free Encrypted Backups
Spymachttp://spymac.com/ - 1 GB
Rediffhttp://rediff.com/- 1 GB
Hotmailhttp://hotmail.com/ - 250 MB
Yahoo!http://mail.yahoo.com/ - 100 MB
~/.mcrypt
# BEGIN FILE
key somepassword
algorithm rijndael-256
#END FILE
backup.sh
#BEGIN FILE
mbox='/var/mail/username'backupaddress='somaddress@gmail.com'tar
-pscj $mbox | mcrypt -q -c /.mcryptrc > \/mail.`date +%m.%d.%y`.tar.bz2.ncecho
| mutt -a /mail.`date +%m.%d.%y`.tar.bz2.nc -s \"Mail backup for
`date +%m/%d/%y`" $backupaddressrm /mail.`date +%m.%d.%y`.tar.bz2.nc
#END FILE
descript file
#> mcrypt -d somefile.tar.bz2.nc
passwd: somepassword
#> ll
#> somefile.tar.bz2
|