Web lists-archives.com

Re: rsync - newbie question




On Sat, 2018-05-12 at 13:58 -0500, Richard Owlett wrote:
> On 05/12/2018 12:50 PM, Tixy wrote:
> > On Sat, 2018-05-12 at 13:28 -0400, Jude DaShiell wrote:
> >> Another hierarchy in Linux not to sync is /system for the same reason
> >> you don't sync /proc.
> > 
> > Presumably you meant /sys ?
> > 
> > Basically, the OP probably don't want to try and sync mount points for
> > things that aren't ordinary filesystems and that's quite an extensive
> > and variable list.
> 
> I exclude /media for similar reasons. Or would exclude it anyway?

The command options I was thinking about would stop a command crossing
over into another filesystem. E.g. if my desktop automounts a USB stick
as /media/tixy/disks-label, that directory path would be part of the
root filesystem, but the actual contents of the USB stick that you see
under that path wouldn't be included in the command. So you'd just get
an empty directory with that path (/media/tixy/disks-label).

I googled for rsync man page [1] and it does seem to have the same
option as the cp command for this:

        -x, --one-file-system
            This tells rsync to avoid crossing a filesystem boundary
        when recursing. This does not limit the user's ability to
        specify items to copy from multiple filesystems, just rsync's
        recursion through the hierarchy of each directory that the user
        specified, and also the analogous recursion on the receiving
        side during deletion.
        
I don't know what it is you're trying to achieve. If your intent is to
create an identical copy of a system as some kind of backup, you'll also
need to make sure you copy file permissions, owners and special
attributes, duplicate hardlinks and possibly other things I haven't
thought of. That will require root privileges to execute and the correct
set of commandline options. Looking at that rsync man page I found, that
would be options like -p -X -H. (Note, I haven't used rsync before so
don't rely on my advice too much).

[1] https://linux.die.net/man/1/rsync

-- 
Tixy