There are a number of approaches to this. The disk dump option mentioned by overlord73 is one. There are 2 others that are open source and therefore free.
The first is PartImage which is part of the Knoppix disk and is great. P/Image off Knoppix means that you can create compressed images of the drive very easily. You just need to get your head around the use of it.
The second is the one I use and that is rsync. This can be implemented on a live system and means a second disk is as up to date as you wish it to be because it can be controlled via a cron scritp. The big advantage of rync is that once it is run it will update only the files that have changed since the last time. If you give it the correct switches it will delete the data that has been deleted so in this way it is a 100% record of the source. This also allows a straight swap if the need arises. I use this system for my home partition.
Example of the line in my cron.hourly script is;
rsync --delete-after -avH /home/ /mnt/backup/home > /var/log/backup.log
some explanation;
I made the following script to backup the home partition and the output sent to a log file;
#!/bin/bash
#mount /dev/hda6 on /mnt
mount -t ext3 /dev/hda6 /mnt
#backup files to hda6
rsync --delete-after -avH /home/ /mnt/backup/home > /var/log/backup.log
#umount hda6
umount /dev/hda6
To make it executable do chmod 700 ./backup
to run it do ./backup
I put it in /etc/cron.hourly
The following entry was put in /etc/crontab so that a backup is made 10 min past each hour.
# m h dom mon dow user command
10 * * * * root /etc/cron.hourly/backup
I now have hda6 permanently mounted so no longer use the mount option as I was advised this is not good practice with cron.
In terms of using cron and rsync many admins use routines whereby rsync is used to create multiple backups.
Hope this gives some insight into your choices. Linux and oss is really wonderful in comparison to closed source.
Last edited by TigerOC; 02-11-2005 at 02:36 AM.
|