LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-21-2010, 11:34 AM   #1
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Rep: Reputation: 31
Need some CRON help


I've done some reading about CRON and I can't seem to find a good resource that explains it. In particular, there seems to be a system level CRON and then individual user CRON, and also ways to run things as root from the individual user CRON. I haven't seen a page that explains both together and suggests the most appropriate way to use it.

I wouldn't have thought this would be all that confusing.

So, how should I be using CRON and can anyone recommend a page with a good explanation of it?

I'm using Debian (Lenny) btw.
 
Old 05-21-2010, 12:08 PM   #2
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48
Quote:
Originally Posted by davidstvz View Post
I've done some reading about CRON and I can't seem to find a good resource that explains it. In particular, there seems to be a system level CRON and then individual user CRON, and also ways to run things as root from the individual user CRON. I haven't seen a page that explains both together and suggests the most appropriate way to use it.

I wouldn't have thought this would be all that confusing.

So, how should I be using CRON and can anyone recommend a page with a good explanation of it?

I'm using Debian (Lenny) btw.
Visit my website http://fruttenboel.verhoeven272.nl/linux/index.html and click on the two entries for 'Crontab' in the navigator frame.

http://fruttenboel.verhoeven272.nl/linux/crontab.html
http://seerofsouls.com/wiki/How-Tos/Crontab

That explains more than I can tell here in a short message.

Never edit the crontab files manually. Always use the vi front end.
 
1 members found this post helpful.
Old 06-02-2010, 01:07 PM   #3
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Original Poster
Rep: Reputation: 31
I looked at those pages now that I have some time, and it's pretty straightforward.

However, is there some system level crontab that isn't tied to a specific user?

If I want to run things as root, should I just switch to root and edit root's crontab?

As an example, these files are in etc but I have trouble finding documentation of them:

Code:
drwxr-xr-x 2 root root 4.0K 2009-10-29 16:58 cron.d
drwxr-xr-x 2 root root 4.0K 2010-04-30 13:13 cron.daily
drwxr-xr-x 2 root root 4.0K 2007-12-25 13:20 cron.hourly
drwxr-xr-x 2 root root 4.0K 2007-12-25 13:20 cron.monthly
-rw-r--r-- 1 root root  724 2008-09-28 06:07 crontab
drwxr-xr-x 2 root root 4.0K 2009-11-12 17:04 cron.weekly

Last edited by davidstvz; 06-02-2010 at 01:16 PM.
 
Old 06-02-2010, 01:29 PM   #4
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
Quote:
Originally Posted by davidstvz View Post
However, is there some system level crontab that isn't tied to a specific user?
/etc/crontab

Quote:
Originally Posted by davidstvz View Post
If I want to run things as root, should I just switch to root and edit root's crontab?
How's "run as root"? As user root? or you want to run system-wide programs? For the latter, just edit /etc/crontab, or add entries in /etc/cron.d

Quote:
Originally Posted by davidstvz View Post
As an example, these files are in etc but I have trouble finding documentation of them:

Code:
drwxr-xr-x 2 root root 4.0K 2009-10-29 16:58 cron.d
drwxr-xr-x 2 root root 4.0K 2010-04-30 13:13 cron.daily
drwxr-xr-x 2 root root 4.0K 2007-12-25 13:20 cron.hourly
drwxr-xr-x 2 root root 4.0K 2007-12-25 13:20 cron.monthly
-rw-r--r-- 1 root root  724 2008-09-28 06:07 crontab
drwxr-xr-x 2 root root 4.0K 2009-11-12 17:04 cron.weekly
The dirs cron.{hourly,daily,weekly,monthly} contains scripts meant to be run at certain moments (the directory names says it all .
crontab and cron.d are the "system-wide" crontabs
 
1 members found this post helpful.
Old 06-02-2010, 01:47 PM   #5
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Original Poster
Rep: Reputation: 31
I guess that's relatively straightforward then. Now I'm not even sure what trouble I was having in the past.
 
  


Reply



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
cron.hourly cron.weekly cron.monthly and 0anacron. Are they necessary? glore2002 Debian 2 09-30-2009 08:57 PM
Cron appears to be messed up (E: cron: subprocess post-installation script returned e bujutsukai Linux - Newbie 1 07-24-2008 03:39 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:55 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration