[ale] Backup/Restore Question
Bjorn Dittmer-Roche
bjorn at sccs.swarthmore.edu
Mon Feb 16 11:28:05 EST 2004
On Mon, 16 Feb 2004, Robert Heaven wrote:
> For years I've been running backups in /etc/crontab (running as a
> "non-root" user and logging in using authorized_keys) that look like
> this:
>
> nice tar -czpf - /usr/data | ssh user at storagehost "cat - >
> /raid/backup/user_data.tgz"
Why not dump/restore or amanda? Your technique works fine if you've got
the disk space, I'm just wondering.
> My question is: I've never had to do a restore and I was wondering what
> the inverse of this would be? My first guess would be to log into the
> storagehost and do something like this:
I always practice restores when it's other people's data, just to be sure.
In this case, you could create a dummy user and practice on that.
> cd /raid/backup
> cat user_data.tgz | ssh user at firsthost tar -xzpf -
>
> The only problem I can see with this is, it will untar in the user's
> home directory. Is there a better solution?
One option is to copy the tar file into their home and let them deal with
it. Another is to extract just the file they need on the backuphost and
copy that over. My preferance is to setup a place for restores. eg.
/tmp/restore. In that case, your job is to restore their entire archive
from, say, yesterday, to this place and their job is to take what they
need before you delete it again. The syntax would be something like this:
cat user_data.tgz | ssh user at firsthost ( cd /tmp/restore ; tar -xzpf - )
> I was reading the man page and it looks like I might solve my problem by
> using "tar -czpPf" when creating the backup. Would I also need to use
> -xzpPf in the restore?
-P, at least on FreeBSD, makes paths absolute. That will only make your
problem harder since it might always try to restore to the same place and
that could obliterate files since tar overwrites files when extracting.
I would stay away from that since you really don't want to muck with
people's data, but someone else might know more.
bjorn
More information about the Ale
mailing list