[NBLUG/talk] Automatic backups

Lincoln Peters sampln at sbcglobal.net
Mon Aug 14 13:30:42 PDT 2006


On Sunday 13 August 2006 17:06, Walter Hansen wrote:
> Lincoln Peters wrote:
> > I'm thinking that I should be able to get a complete backup of my home
> > directory to an external hard disk (mounted at /backup) by using the
> > following rsync command:
> >
> > rsync -rlptgoHES --delete-during ~ /backup/
> >
> > Anyone see any reason why this wouldn't work, and/or a better way to do
> > it?  I don't see any problems myself, but I thought I should ask, just in
> > case I made some mistake that would render the backup completely useless.
>
> I don't see a -E in the man page, but all the rest seem fine. 

The -E switch preserves the executability of the files being copied.

> ~ should 
> auto expand out to home. Cept for not knowing what E does looks fine to
> me. I'd test it manually and then set it as a cron task.

It runs without error.  But just because it runs without error doesn't always 
mean it's doing what I want (it could be doing what I say without doing what 
I mean, you know).  Which is why I thought I'd bring it up here.

>
> I was using:
>
> rsync -axHv --del /home/* /mnt/backup
>
> and it worked pretty nice.

Let's see...based on my understanding of rsync (which is mostly derived from 
the man page):

-a expands to -rlptgoD.  I didn't use -a because I wasn't interested in 
preserving device files or special files (which is accomplished by the -D 
switch), so I wrote out the expansion, omitting the unnecessary -D switch.  
Besides, you can't copy device files unless you're logged in as the 
superuser.

-x should be irrelevant in my case, since my home directory is restricted to 
one (admittedly very large) filesystem.  I'm sure that there are situations 
where -x would be invaluable (e.g. backing up the root filesystem); this just 
isn't one of them.

-H causes hard links to be preserved.  We're both doing that.

-v increases verbosity, which I would think unnecessary (and probably 
distracting) for something that will be automated with cron.

--del is an alias for --delete-during, so no difference there in our 
implementations here.

-S (which I used but you didn't) creates "sparse" files when possible, thus 
saving space on the target drive.  Possibly useful when the volume you're 
backing up to is slightly smaller than the volume you're backing up!


-- 
Lincoln Peters		<sampln at sbcglobal.net>

Leona, I want to CONFESS things to you ... I want to WRAP you in a SCARLET
ROBE trimmed with POLYVINYL CHLORIDE ... I want to EMPTY your ASHTRAYS ...



More information about the talk mailing list