To be honest, once the 'old' files are in place, and the above
criteria are met, you can just;

     find /home/shared -exec chgrp users {} \;

as root and you shoulnd't need any cron jobs...
If the primary group isn't changed then files created outside of the g+s
hierarchy will be the non-users group and won't change to it on being
mv'd into the shared-directory area.  Same for old files creat(2)'d
before the primary group is changed.  So the cron'd find helps mop up
and, with the print, alerts the user by email to the kind of thing going
"wrong".

Cheers, Ralph.

Neil & Ralph,
While I'm getting the directory set up with all the old items I'm finding that the g+s property isn't put into copied directories. Although there wouldn't be much of this sort of copying when using the arrangement normally, I do feel I need to routinely check and adjust the permissions in case there is a directory copy.

I've encountered some strange and inconsistent permissions when copying directories from Windows, i.e. from NTFS. I got several permissions shown as (big) "S". According to one website this means setgid ("s") but WITHOUT searching ("x"). I just had to add "x" to get them right. Copying a directory from ext4 is more sane but doesn't give me what I need.

So I'm going to put 2 'find' commands into cron.  The directory one will be:
find /home/shareddocs -type d ! -perm -g=rwsx -ls -exec chmod g+rwsx {} +
and the file one:
    find /home/shareddocs -type f ! -perm -22 -ls -exec chmod g=u {} +

Let me know if you think these are wrong.

Thanks,
John

--
Next meeting:  Bournemouth, Tuesday, 2014-10-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread on mailing list:  mailto:dorset@mailman.lug.org.uk
How to Report Bugs Effectively:  http://goo.gl/4Xue

Reply via email to