Symlinks in source path with --relative - Tools

This is a discussion on Symlinks in source path with --relative - Tools ; Dear Experts, I have a fairly straightforward backup script that does something like this: cd / rsync -a --delete --relative home/phil/important backupserver:/backup/foo/ This was working fine and, for example, /home/phil/important/file1 was copied to /backup/foo/home/phil/important/file1 on the backup server. But then ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Symlinks in source path with --relative

  1. Symlinks in source path with --relative

    Dear Experts,

    I have a fairly straightforward backup script that does something like this:

    cd /
    rsync -a --delete --relative home/phil/important backupserver:/backup/foo/

    This was working fine and, for example, /home/phil/important/file1 was
    copied to /backup/foo/home/phil/important/file1 on the backup server.

    But then I changed the disk partition arrangement on the source
    machine. Before, /home was a filesystem; now there's a filesystem
    called /data, and /home is a symlink to /data/home:

    ls -l /
    ....
    drwxr-xr-x 6 root root 4096 Oct 9 2007 data
    lrwxrwxrwx 1 root root 10 Nov 21 2006 home -> data/home/
    ....

    Now, it seems that rsync notices this symlink and tries to recreate it
    on the backup server because of the -l implied by -a. This is not what
    I want. However, I do want any symlinks inside /home/phil/important to
    be copied as links, so I can't simply drop the -l.

    I note that there are various options related to symlinks, but as far
    as I can see none of them does what I want. Have I missed something?

    Note that "cp --parents -a" seems to have the behaviour that I want.


    Thanks for any suggestions,

    Phil.




    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


  2. Re: Symlinks in source path with --relative

    On Wed, 2008-08-13 at 13:01 +0100, Phil Endecott wrote:
    > I have a fairly straightforward backup script that does something like this:
    >
    > cd /
    > rsync -a --delete --relative home/phil/important backupserver:/backup/foo/
    >
    > This was working fine and, for example, /home/phil/important/file1 was
    > copied to /backup/foo/home/phil/important/file1 on the backup server.
    >
    > But then I changed the disk partition arrangement on the source
    > machine. Before, /home was a filesystem; now there's a filesystem
    > called /data, and /home is a symlink to /data/home:
    >
    > ls -l /
    > ...
    > drwxr-xr-x 6 root root 4096 Oct 9 2007 data
    > lrwxrwxrwx 1 root root 10 Nov 21 2006 home -> data/home/
    > ...
    >
    > Now, it seems that rsync notices this symlink and tries to recreate it
    > on the backup server because of the -l implied by -a. This is not what
    > I want. However, I do want any symlinks inside /home/phil/important to
    > be copied as links, so I can't simply drop the -l.


    Upgrade the sending rsync to 3.0.0 or newer (which always sends
    ancestors of a source argument as directories, not symlinks, with
    --relative) or pass --no-implied-dirs to avoid processing the ancestors
    of home/phil/important at all.

    Matt

    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iEYEABECAAYFAkii5mcACgkQC+xSYN/Rlfs/vACgh0AHbB6USyTSEOI5ZjcNcmzJ
    lwAAn3xLEhL1cfJnlupVBo64HWVP0W/h
    =2Pwo
    -----END PGP SIGNATURE-----


  3. Re: Symlinks in source path with --relative

    Matt McCutchen wrote:
    > On Wed, 2008-08-13 at 13:01 +0100, Phil Endecott wrote:
    >> I have a fairly straightforward backup script that does something like this:
    >>
    >> cd /
    >> rsync -a --delete --relative home/phil/important backupserver:/backup/foo/
    >>
    >> This was working fine and, for example, /home/phil/important/file1 was
    >> copied to /backup/foo/home/phil/important/file1 on the backup server.
    >>
    >> But then I changed the disk partition arrangement on the source
    >> machine. Before, /home was a filesystem; now there's a filesystem
    >> called /data, and /home is a symlink to /data/home:


    >> Now, it seems that rsync notices this symlink and tries to recreate it
    >> on the backup server because of the -l implied by -a. This is not what
    >> I want. However, I do want any symlinks inside /home/phil/important to
    >> be copied as links, so I can't simply drop the -l.

    >
    > Upgrade the sending rsync to 3.0.0 or newer (which always sends
    > ancestors of a source argument as directories, not symlinks, with
    > --relative) or pass --no-implied-dirs to avoid processing the ancestors
    > of home/phil/important at all.


    Thanks for the quick reply Matt. I have upgraded to 3.x and it now
    seems to be doing what I want.

    Cheers, Phil.




    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


+ Reply to Thread