Re: rsync backup question
>>>>> Alan Chandler <alan@chandlerfamily.org.uk> writes:
>>>>> On 22/07/11 00:39, Thomas H. George wrote:
>> I partitioned a 1 TG usbdrive as ext3, mounted it as /usbmem and
>> entered the command rsync -r / /usbmem.
BTW, there's a convention of using /mnt for temporary mounts.
[…]
> Isn't this going to go recursive?
> Since usbmem is another file system the -x flag should prevent this.
It will prevent it from descending into /media, /sys/, /proc/
and /tmp/ just as well. Unfortunately, it will also prevent
rsync(1) from descending into /usr/, /var/ & /home/, if these
are on separate filesystems. If it's the case, I'd recommend to
use --exclude= instead, like:
# rsync -a -rH --exclude=/{media,mnt,sys,proc,usbmem}/ -- / /usbmem/
> Also as another poster has said you need the -a and -H flags to
> maintain file ownership and copy hardlinks
[…]
--
FSF associate member #7257
Reply to: