-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 As has been pointed out to you your problem is not hard links. Your problem is the indiscriminate use of a root operation (a chown) during the restoration process.
You should be solving this by either: A) backing up and restoring the original owner of the files (directly or via --fake-super) B) backing up each user's files and only their files. The solution is not to refuse to backup any file that is a hard link. There are legitimate reasons to have hard links and ignoring them means you aren't backing up everything. On 08/14/13 12:37, Sherin A wrote: > On Wednesday 14 August 2013 08:29 PM, Justin Pryzby wrote: >> On Wed, Aug 14, 2013 at 04:09:46PM +0530, Sherin A wrote: >>> On Tuesday 13 August 2013 10:24 PM, Justin T Pryzby wrote: >>>>> PS : if any one interested in making a patch with an >>>>> additional option for rsync for excluding hardlinks with >>>>> -links +1 links , please help me , it is easy to check the >>>>> file with an lstat / stat system call. Or is it possible >>>>> to get a developer documentation for rsync with the >>>>> detailed info ? >>>> You could do that with --exclude, but first, think about the >>>> implications of that. Your users could make hardlinks to >>>> system files and those owned by other users files (which they >>>> can stat) and that would cause rsync to avoid backing up >>>> those files (by either name, since link count is shared >>>> between all links, of course). >>>> >>>> Justin >>> Any further information related with this ? >> On what? How to implement with --exclude? Or how users could >> cause files to be not backed up, making such an implementation a >> terrible idea? >> >> Justin (off list) > It won't work with --exclude , because > > 1) we are identifying all hardlinks with find command and will > be placed in a test file for a user 2) Then we do the rsync with > --exclude-from=somefile.txt > > But how we solve this timed raced conditions as follows which > happen in between the above to steps , > > h...@hax.com [~/hax]# for i in {1..5000}; do ln -f /etc/shadow $i; > done > > Still the only solution to embedded the option to avoid hardlink if > need . > - -- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~ Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. ke...@futurequest.net (work) Orlando, Florida k...@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/ iEYEARECAAYFAlILtoMACgkQVKC1jlbQAQdN/ACgng5otqc0Th8HG0WTO4grLecY CAUAnjaXbHp6v7/O//7uFMlLMR2hXPBy =L/0o -----END PGP SIGNATURE----- -- 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