On Wed, Aug 11, 2010 at 01:32:42PM -0400, Brian Cuttler wrote: [Set u+s on directories, don't worry about owners]
It seems to work relatively well. I get an error about not being able to chgrp the files owned by other users, and, in my case, the group ends up wrong because it's not supposed to be the same on both ends (www-data on destination, something else on source). However, because of the former problem, at least the extant files stay readable until I can fix-up the group problem caused by the latter. If I further chown them to www-data, then they don't get their gid hosed the second time around. Not an ideal solution, but seems workable for the time being. Aside: chown really needs a flag that says "set GID on directories but nothing else". Right now I do this, which is the only right thing to do when filenames might contain anything, including whitespace or newlines: setperms () { local perms="$1" local fileperm="$2" local dirperm="$3" local own="$4" local dir shift 4 for dir in "$@" do if test -d "$dir" then find "$dir" -xdev -type d -print0 | xargs -0 --no-run-if-empty chmod "$perms","$dirperm" -- find "$dir" -xdev -type f -print0 | xargs -0 --no-run-if-empty chmod "$perms","$fileperm" -- chown -R "$own" "$dir" fi done } setperms u=rwX,o=rX g=rwX g=rwxs owner:group /path/to/whatever -- A Weapon of Mass Construction My emails do not have attachments; it's a digital signature that your mail program doesn't understand. | http://www.subspacefield.org/~travis/ If you are a spammer, please email j...@subspacefield.org to get blacklisted.
pgpqbaSRuWBh3.pgp
Description: 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