mtweidmann Posted February 20, 2003 Report Share Posted February 20, 2003 Hi, I've made a dirctory called /home/shares, and also created a group called shares (gid=500). The idea was that anything in the shares folder would belong to shares, and accessable by any users in the shares group. So I'd have an area for sharing some files, between certain user accounts. I want to set it up so that ALL the files that are in /home/shares ALWAYS belong to shares. So if root were to create a file the directory it would automatically belong to shares, so that other members of the group could alos read/write the file. At the moment I just manually change the files permission as I have to. Does anyone know of a command/script/etc that would do this ofr me? Quote Link to comment Share on other sites More sharing options...
ramfree17 Posted February 20, 2003 Report Share Posted February 20, 2003 a search in freshmeat reveals dnotify. its description states dnotify is a simple program that makes it possible to execute a command every time the contents of a specific directory change in Linux. It is run from the command line and takes two arguments: one or more directories to monitor and a command to execute whenever a directory has changed. Options control what events to trigger on: when a file was read in the directory, when one was created/deleted, etc. so im thinking you can set this and create a script that changes all group ownership of the directory to share and what not. you could get away with setting a share user and then swoop the files with chown -rf share.share /home/shares (check the command. my cli memory is getting rusty), or you can ask the bash nuts in this board for something more fancy. ciao! Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted February 20, 2003 Report Share Posted February 20, 2003 Cool! This "dnotify" thing seems to be interesting. Indeed, it could be made to execute: chgrp -R shares /home/shares provided all shares' users have a umask of 002, and that dnotify is run by root or an ID belonging to shares. Another solution is to create a FAT32 partition, mount it under /home/shares with uid=0,gid=<shares' gid>. Yves. Quote Link to comment Share on other sites More sharing options...
ramfree17 Posted February 20, 2003 Report Share Posted February 20, 2003 nice try tYY. i know you are also a bash nut so you have to whip up something fancier than that. even i can do that (i think :#:). ciao! Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted February 21, 2003 Report Share Posted February 21, 2003 As Paul said on Cooker ML: "less is more or less more, but a bit more (a.f.a.i.k)" :P :lol: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.