Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
what are some recomendations for Linux programs for DDS drives Tape Backup or Harddrive Backups(on to external hardrive)
Thanks in Advance
Slowpok

You don't need any program for that. Just write a simple script to do a backup and put it in your crontab, so it runs daily.

eg:
#!/bin/bash
#
# creates backups of essential files
#
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 -o -mtime -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 -o -mtime -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
and your crontab entry:
1 3 * * * /root/scripts/daily_backup.sh
will run it at 3:01am every night. Add this line using contab -e when root.

I find it better to make a no-tar backup without compression, so I can just update it using rsync. It does take more space but its a lot faster to do a backup, and a lot faster to make a recovery. And also, its very difficult to browse the contents of a tar archive, so restoring perhaps a single file is much easier when its not tarred.
Harddisks are getting cheaper every day.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |