LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   crontab and run-parts (http://www.linuxquestions.org/questions/slackware-14/crontab-and-run-parts-362795/)

gavinbeatty 09-12-2005 08:46 PM

crontab for all users and run-parts
 
Wonderong if run-parts descends into subdirectories.

I'm trying to set up user based crontabs that are EASY to manage and thought of using directories like /etc/cron.{daily,monthly,weekly,hourly}/gavin etc for all users of my system.

Is there an easier/previosly established way?

If not, will this method work and (going back on-topic now!) will run-parts simply descend into EACH user's directory and ruin the whole contrived system?

[edit] corrected spelling errors in pseudo bash script

Thanks in advance for any help or advice.
Gavin Beatty

archtoad6 09-13-2005 04:40 PM

Code:

man 1 crontab

gavinbeatty 09-13-2005 07:23 PM

I suppose there may have been some confusion due to the way I phrased my question.

I am completely familiar with using
Code:

crontab -e whatever_user
I would like to know about a simple way to manage locations for all scripts to be run from so as reduce fiddly crontab entries for each user. ie. the user could ask me to simply add their required script into /etc/cron.{daily,monthly,weekly,hourly}/whatever_user instead of them having to edit their crontab AND have me make sure it's correct with the placement of their scripts. This also STILL leaves me to have to install their scripts into /etc/cron.something

Slackware uses run-parts (try man run-parts and see how UNverbose it is) to descend into the cron.{daily,monthly,weekly,hourly} directories. So MY QUESTION is DOES RUN-PARTS DESCEND INTO SUBDIRECTORIES?

I may be completely overlooking a very obvious solution so PLEASE GIVE ADVICE. As far as I can see without much experience or complex, my user subdirectory solution seems PERFECT if run-parts behaves. I do NOT want run-parts running all my users' individual backup scripts when running system cron tasks

gbonvehi 09-13-2005 07:45 PM

It will not descend subdirectories, you can see run-parts script at /usr/bin/run-parts.
It will only run files that are executables and do not contain ignore subfixes.

You could create a cron.XXXX dir in each user home (you could use a skeleton for that) and a crontab for each user too which will be like root's one, calling run-parts perdirectory.

gavinbeatty 09-13-2005 07:56 PM

thanks a million gbonvehi. I knew there was bound to be something stupid about my question but now my whole post falls under that category. Of course I should have checked to see if it was a script, it's the obvious choice for implementing run-parts functionality and the man entry should have bee a HUGE indicator!

Thanks again! I think I'll stick with my original method simply because I don't want users to have to worry about permissions on their cron directories. Some of them are bound to have silly scripts that give away important info if readable. I'm trying to go for a "Default Deny" policy so my method seems more manageable.

Really appreciate the help


All times are GMT -5. The time now is 05:16 AM.