[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: crob chgrp



Chris Robinson wrote:
> I am trying to run the folloing in woody using cron so my cron
> 
> 2,12,22,32,42,52 * * * * /path to macro
> 
> #!/bin/sh                                                              
> #                                                                      
> #                                                                      
> chgrp -R nogroup /usr/local/apache2/www/foodmanagementsystems.com/gary 

That triggers alarm bells with me!  That you want to do that causes me
to wonder why you want to do that.  This sounds like a bad idea to
me.  There will always be a window of time when a new file could be
the wrong group.  It always changes all of the files.  Danger Will
Robinson, danger!

> I can not find a log.  The macro does not work via cron.  The macro runs 
> if I run it as root.

Only root can chown files to another user.  Only root can chgrp files
to arbitrary groups.  Users can only change the group to groups they
belong to and no user should be in the nogroup group.

Without knowing all of the details of what you are trying to do let me
suggest that almost certainly what you want is to add gary to the
www-group, and then chmod g+ws on the directories.  The apache web
server runs as the www-data user in the www-data group.  Doing the
above configuration will allow both the apache web server process and
the user process in the www-data group to access the data.  There is
never a time when the file will be owner/group incorrectly.  No cron
task is needed.  The files are not continously thrashed.

Say more if you want more hints.

Bob



Reply to: