I originally sent this email to Nathan but he bounced it back to me.
Maybe the email page, http://www.rsnapshot.org/email/, could be modified
to show Nathan as the original author and David as the current developer
lead.
I am not a member of the rsnapshot-discuss list, so send me mail
directly if you have questions about my suggestions.
Great project. Thanks.
Steve Herber herber < at > thing.com work: 206-221-7262
Security Engineer, UW Medicine, IT Services home: 425-454-2399
---------- Forwarded message ----------
Date: Fri, 6 Jan 2006 12:20:29 -0800
From: Nathan Rosenquist <nathan < at > rsnapshot.org>
To: Steve Herber <herber < at > thing.com>
Subject: Re: rsnapshot suggestions and sample shell script
Thanks for the e-mail. Unfortunately, I'm no longer maintaining rsnapshot.
However, David Cantrell has taken over maintenance and future development.
I would recommend re-posting this to the rsnapshot-discuss mailing list, where
you can get feedback from those more actively involved in the project.
Sorry it took so long to get back to you, I was on vacation until now.
Thanks!
-Nathan
On Jan 2, 2006, at 2:45 PM, Steve Herber wrote:
I have been using your rsnapshot script for the past few months and really
enjoy having it. Fortunately, I have never had to restore any data. That
is often the best part of having a backup.
I backup three servers and I did not want to use passwordless ssh, so I used
the gentoo keychain script in my root .bash_profile:
-------------------------------------
# /etc/skel/.bash_profile:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/skel/.bash_profile,v 1.10
# 2002/11/18 19:39:22 azarah Exp $
#This file is sourced by bash when you log in interactively.
[ -f ~/.bashrc ] && . ~/.bashrc
keychain ~/.ssh/id_dsa
. ~/.keychain/$HOSTNAME-sh
-------------------------------------
The keychain script is from the Gentoo project:
-------------------------------------
$ keychain
KeyChain 2.3.4; http://www.gentoo.org/projects/keychain
Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL
-------------------------------------
To keep rsnapshot running I need to login as root once to set my ssh keys
after each reboot.
My script, rsnapshot.sh, which I have attached, checks to make sure the
keychain is enabled and verifies that the snapshot root location is
mounted. The script should really get the mount point out of the
rsnapshot.conf file, but it might be better as part of rsnapshot itself.
I wonder if it would be possible to integrate the checking in my script
and the keychain functions into rsnapshot?
I did run out of disk space yesterday. Once that happened I realized
that any of the following snapshots would not be hard to linked back to
the "original" files. I used a command like this:
ls /export/snapshot/*/sue/etc/zshrc
to find the snapshots that were linked together and those that had started
a disconnected set. I deleted the disconnected sets and played with
snapshot -vt {hourly, daily, weekly, monthly} to force in a new set.
I went for out of space to lots of free space when I removed the
disconnected sets.
It might be interesting to build a script or an option to rsnapshot to
fully populate a backup tree all at once and have another option that
would delete sets that failed like mine did, given a test file to check
link counts against.
This is another safety feature around failed snapshots. If a rsnapshot
could not find the 'previous' set for use with --link-dest, rsnapshot
would to fall back to an even earlier set, and log the problem.
If there were no earlier sets then rsnapshot would act just like the
current version.
Another suggestion has to do with removing old snapshots. Most snapshot
rotations start with a removal of the oldest. I think it might be safer
to rename it first, then move the others, and if that worked, then
remove the tree:
rsnapshot -vt hourly
echo 378 > /var/run/rsnapshot.pid
/bin/rm -rf /export/snapshot/hourly.1/
mv /export/snapshot/hourly.0/ /export/snapshot/hourly.1/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
--rsh=/usr/bin/ssh --link-dest=/export/snapshot/hourly.1/big/ \
root < at > big:/etc/ /export/snapshot/hourly.0/big/
touch /export/snapshot/hourly.0/
would change to:
rsnapshot -vt hourly
echo 378 > /var/run/rsnapshot.pid
mv /export/snapshot/hourly.1/ /export/snapshot/hourly.1.378/
mv /export/snapshot/hourly.0/ /export/snapshot/hourly.1/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
--rsh=/usr/bin/ssh --link-dest=/export/snapshot/hourly.1/big/ \
root < at > big:/etc/ /export/snapshot/hourly.0/big/
touch /export/snapshot/hourly.0/
/bin/rm -rf /export/snapshot/hourly.1.378/
I would add error checking at each step. The final rm would only run
if all the earlier steps succeeded. This could be important if the
rsync fails. You would have already deleted a backup but not replaced
it with a new backup.
In summary, I have these suggestions:
support keychain for a bit more ssh security
verify that the destination mount points are mounted
fall back to the most recent successful previous
backup if it exists for the --link-link option
remove old snapshots only after the new snapshot succeeds
Great script. Thanks for all your work.
Cheers!
Steve Herber herber < at > thing.com work: 206-221-7262
Security Engineer, UW Medicine, IT Services home: 425-454-2399
