-b and --backup-dir options, should backup-dir be INSIDE the sync'd folder?

Sean Hammond sean.hammond at gmail.com
Sat Dec 31 18:54:38 GMT 2005


On 12/30/05, Wayne Davison <wayned at samba.org> wrote:
>
> On Thu, Dec 29, 2005 at 03:37:01AM +0000, Sean Hammond wrote:
> > I'm using rsync to keep 3 copies of a folder named 'sync' synchronised.
>
> You might want to check into using unison for that (or even using a
> version control program, such as cvs).



Meh. rsync does the job well enough, I just wrote scripts for it.


> rsync -r -b --backup-dir=backup --delete -z -i --progress sync/ user at host
> :sync/
>
> You'd be better off putting the backup dir outside the transfer by using
> something like --backup-dir=../backup .  If that is not possible, you
> should exclude the backup dir from the deletion pass (and also from the
> files being copied) by using:
>
>     --exclude=/backup



Thanks.


> Also I noticed that when I 'checked out' a copy of the remote folder onto
> a
> > new machine and then used rsync to backup back to the remote host, it
> copied
> > every single file. I think this may be because I should have 'checked
> out'
> > the copy in the first place using rsync with the --times option?
>
> Yes, that would do it.  You need to either always use -t (to make the
> quick-check always work) or use -c (which is a better but slower check
> to find the files that have actually changed).


Yeah, that seems to work.



> > Finally when running backups from this new machine, rsync keeps feezing.
>
> I wonder if that might be caused by rsync deleting a file in the backup
> dir over and over again.  You can use a command such as strace on the
> program to know for sure.
>

Maybe, I guess. But it didn't look like it. I had verbose mode on, and it
appeared to keep freezing part way through uploading a file. But it was a
different file every time I ran it. If it happens again I'll investigate
further.

Anyway, I basically started again, downloaded a new copy of the folder using
the --times option, and now it seems to be working fine.

I'd just like to thank everyone involved for the rsync program. It's a very
useful little tool, it's helping me keep my work safely backed up with
barely any effort and I expect I'll be using it throughout my three years of
study.

--
Sean's mailing list bin
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the rsync mailing list