LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-12-2005, 08:46 PM   #1
gavinbeatty
Member
 
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 08:47 PM.
 
Old 09-13-2005, 04:40 PM   #2
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
Code:
man 1 crontab
 
Old 09-13-2005, 07:23 PM   #3
gavinbeatty
Member
 
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
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
 
Old 09-13-2005, 07:45 PM   #4
gbonvehi
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, 07:56 PM   #5
gavinbeatty
Member
 
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
 
  


Reply


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 7 08-18-2014 07:31 AM
What does the run-parts mean in crontab? mTorbin Linux - Newbie 15 04-27-2012 04:53 PM
Script doesn't run in crontab dani81 Linux - General 1 11-16-2004 04:42 AM
How to run useradd from crontab? adrianphicks Linux - Enterprise 3 08-03-2004 01:00 AM
Can't run F-Prot with Crontab maxflex Slackware 7 07-31-2004 11:11 AM


All times are GMT -5. The time now is 01:50 PM.

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