On 14/02/12 10:26, Cal Edwards wrote:
Hi.

I want to create directories and files under a specific directory with
specific ownerships and permissions.

The problem is that I create directories in a hierarchy of images from
digital cameras.
My family members need to be able to access those across the network via
samba shares.
When I create a directory I dont want to have to chown it to make it
accessible.
I cant give the family members access to my own group (the default of
mkdir).

What I do now is as follows:

First I create a top directory

mkdir topdir
chmod 775 topdir
chown luke:bridge topdir
cd topdir

Is there a way to do the following without having to use chmod and chown

mkdir subdir
chmod -R 775 /topdir
chown -R luke:bridge /topdir

Ok. I know I can use umask to set the permissions.
I want to be able to create a new subdir and be sure that it has the same
ownership as topdir.

Can anyone suggest a better solution?

Thanks.

Luke.
try
chmod 2775 topdir
that will set the permissions on the subdir correctly without doing a chown.

consider setting the primary group to be the same accross the whole family. that way whenever a file is created it will be the correct group.

Grant
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to