mortee wrote:
Hi,
I just had rdiff-backup erase *all* my backups. That is just plain wrong.
Hi mortee,
I have had a similar issue which actually erased my / directory, (well a
staff member did it). This was because he used --force with a restore
and ended up erasing his root (/) directories. Made a pretty bad mess of
things. Basically, I now caution all users of rdiff-backup to restore
only to a fresh target directory, then move the files into place. This
way you avoid using --force at all really.
If you would like to submit a patch that prevents --force from really
forcing and behaving differently, I am sure one of the active
maintainers would consider it. I am sorry you lost all your data in this
way, however you can see that if something is designed to force
something, and makes you use --force to do it, it expects you know what
you are doing. I agree it could be more considerate, and I have had just
as bad an experience as you (perhaps).
Anyway, as Warren Guy has requested, I know generally try and backup by
backups to another location if at all possible. This accounts for not
only software and filesystem problems, but loss of backup server etc.
It relies on the layout like so:
/storage/backups-repo/servername/jobname/
where jobname is the rdiff-backup repository.
Here is a somewhat sanitized script that does just that, ssh into a
target server, figure out which backups have worked, and backup them up
offsite, keeping 3 good backups of the backups.
It relies on the layout like so:
/storage/backups-repo/servername/jobname/
where jobname is the rdiff-backup repository.
-----------------------------
#!/bin/bash
# script to do the offsite backup
# assumes you have keyed ssh, root access to the backuphost
BACKUPHOST=ernie
BACKUPPATH=/storage/nearline-backups
BACKUPDEST=/storage/offsite-backups/
# first find the repos to backup and check them.
# create a list of good repos and back them up.
# email the list of bad repos to support
LISTFILE=/storage/tmp/current-list-of-backups.txt
GOODREPOLIST=/storage/tmp/current-list-of-completed-backups.txt
GOODHOSTNAMES=/storage/tmp/current-list-backup-sources.txt
# first create the list of all repos on the backuphost
ssh $BACKUPHOST find $BACKUPPATH -type d -maxdepth 3 |grep
rdiff-backup-data | grep -v "/archive/" > $LISTFILE
touch $GOODREPOLIST
rm $GOODREPOLIST
touch $GOODREPOLIST
# ok got the list now check it for broken backups
for REPO in `cat $LISTFILE`
do MARKERCOUNT=`ssh $BACKUPHOST ls $REPO/current_mirror*|wc -w`
if [ $MARKERCOUNT -ne 1 ]
then echo $REPO BAD
else echo $REPO >> $GOODREPOLIST
fi
done
# sort out the unique hostames from the list and add any missing/special
ones with an echo
cat $GOODREPOLIST |cut -f4 -d "/"|sort|uniq > $GOODHOSTNAMES
#echo scripts >> $GOODHOSTNAMES
echo pictures >> $GOODHOSTNAMES
# then back each one of the hosts up individually
for HOST in `cat $GOODHOSTNAMES`
do echo "Backing up backup of $HOST from $BACKUPHOST!"
/usr/bin/time -o /storage/tmp/$HOST.time -f "%E total %P CPU"
rdiff-backup -v5 --print-statistics $1 $2
$BACKUPHOST::/$BACKUPPATH/$HOST $BACKUPDEST/$HOST
echo "removing increments for $HOST"
rdiff-backup --force --remove-older-than 3B $BACKUPDEST/$HOST
echo "done $HOST"
done
# This is a ugly hack for script that I think should be cleaned up later
but I'm difficult that way - Matt
echo "Backing up backup of scripts from $BACKUPHOST!"
/usr/bin/time -o /storage/tmp/scripts.time -f "%E total %P CPU"
rdiff-backup -v5 --print-statistics $1 $2 $BACKUPHOST::/storage/scripts
$BACKUPDEST/scripts
echo "removing increments for scripts"
rdiff-backup --force --remove-older-than 3B $BACKUPDEST/scripts
echo "done scripts"
# now backing up the stats for future reference
/usr/bin/rdiff-backup /storage/tmp /storage/backup-stats
--------------------------
I should probably put that on the wiki - someone else can if they want.
(I might have time some other time).
thanks
dave
_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki