View previous topic :: View next topic |
Author |
Message |
brazilian_joe Tux's lil' helper
Joined: 14 Mar 2003 Posts: 99
|
Posted: Wed Sep 17, 2003 9:31 pm Post subject: making a group or user own a directory's contents |
|
|
I would like to have all files copied to a directory to ignore the group (and maybe user) in its source location and acquire the group (and/or user) of the directory where it is being copied to. Is it possible? Yes, I can just chgrp, I want automation, I want it to happen unnattended. |
|
Back to top |
|
|
ectospasm l33t
Joined: 19 Feb 2003 Posts: 711 Location: Mobile, AL, USA
|
Posted: Wed Sep 17, 2003 9:59 pm Post subject: |
|
|
Only way I know of doing that is if I'm copying some file into my home directory, which changes the user to my username and group to my primary group. This is probably not what you want. Best thing to do is write a script to do it, and use chgrp and cp in the script. I'm not much for writing scripts, so I direct you to your shell's manual. _________________ Join the adopt an unanswered post initiative today
Join the EFF!
Join the Drug Policy Alliance! |
|
Back to top |
|
|
meowsqueak Veteran
Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Wed Sep 17, 2003 10:15 pm Post subject: |
|
|
Isn't this where the sticky bit on a directory comes in useful? I had a play with chmod +t but I couldn't seem to figure out how it works. |
|
Back to top |
|
|
devon l33t
Joined: 23 Jun 2003 Posts: 943
|
|
Back to top |
|
|
meowsqueak Veteran
Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Thu Sep 18, 2003 1:19 am Post subject: |
|
|
Apologies - not the sticky bit but the 'set group ID on execution bit' - seems it's commonly confused. |
|
Back to top |
|
|
|