Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 09-12-2005, 07:46 PM   #1
Registered: Nov 2003
Location: Ireland
Distribution: Debian testing
Posts: 79

Rep: Reputation: 15
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

Last edited by gavinbeatty; 09-12-2005 at 07:47 PM.
Old 09-13-2005, 03:40 PM   #2
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
man 1 crontab
Old 09-13-2005, 06:23 PM   #3
Registered: Nov 2003
Location: Ireland
Distribution: Debian testing
Posts: 79

Original Poster
Rep: Reputation: 15
I suppose there may have been some confusion due to the way I phrased my question.

I am completely familiar with using
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
Old 09-13-2005, 06:45 PM   #4
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
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.
Old 09-13-2005, 06:56 PM   #5
Registered: Nov 2003
Location: Ireland
Distribution: Debian testing
Posts: 79

Original Poster
Rep: Reputation: 15
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
run-parts gives error on bash script ChoKamir Programming 9 04-11-2017 07:18 AM
What does the run-parts mean in crontab? mTorbin Linux - Newbie 15 04-27-2012 03:53 PM
Script doesn't run in crontab dani81 Linux - General 1 11-16-2004 03:42 AM
How to run useradd from crontab? adrianphicks Linux - Enterprise 3 08-03-2004 12:00 AM
Can't run F-Prot with Crontab maxflex Slackware 7 07-31-2004 10:11 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:48 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration