yetanotheruser at Safe-mail.net
2013-Jul-12 15:33 UTC
How to circumvent "Symlink has no referent"?
Hi, in my backup script I'm using the "-L" option to transform symlinks into referent files/dirs. Now I'm also using the "--delete" option. Unfortunately "--delete" doesnt work if an error like "Symlink has no referent" occurs. So far the only solution for that seems to not use the "-L" option or to add "--ignore-errors". It doesnt seem very wise to me to use "--ignore-errors", so my question is, is there any other way, to just ignore "dead" symlinks? I'd just like to copy the referent files if they exist. If they don't exist (which would produce the error in the subject), I'd like to just copy the symlink. Is there any way of doing that? I googled a lot, but it seems to me that it is not possible. Thanks, Martin
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 You are telling rsync to do something that it can't do because of bad data. That makes it an error. If you have broken symlinks perhaps you should remove them with: find /path -follow -type l -ls -delete On 07/12/13 11:33, yetanotheruser at Safe-mail.net wrote:> Hi, > > in my backup script I'm using the "-L" option to transform symlinks > into referent files/dirs. Now I'm also using the "--delete" > option. Unfortunately "--delete" doesnt work if an error like > "Symlink has no referent" occurs. So far the only solution for that > seems to not use the "-L" option or to add "--ignore-errors". It > doesnt seem very wise to me to use "--ignore-errors", so my > question is, is there any other way, to just ignore "dead" > symlinks? I'd just like to copy the referent files if they exist. > If they don't exist (which would produce the error in the subject), > I'd like to just copy the symlink. > > Is there any way of doing that? I googled a lot, but it seems to me > that it is not possible. > > Thanks, Martin >- -- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~ Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: http://www.sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlHgSNAACgkQVKC1jlbQAQeiZQCfW2GV2FskDx+MLSfuSBsIVZIs WFQAn0f3u6Jb4OHR8ObbisKY4UouJiMY =mn4e -----END PGP SIGNATURE-----
Maybe Matching Threads
- Assistance With "Symlink Has No Referent" Message
- [Bug 13827] New: despite --copy-unsafe-links, rsync does not copy the referent of symlinks that point one level outside the copied tree
- Funny issue with chroot + symlink outside chroot
- Potential incompatibilities between '--delete' and --copy-unsafe-symlinks' ???
- rsyncd.conf chroot yes problem with symlink-ing