Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-10-2003, 07:23 AM   #1
LQ Newbie
Registered: Nov 2003
Posts: 2

Rep: Reputation: 0
problems with crontab for root


I am trying to get my first crontab to work, and I can't see what I'm doing wrong.

I used (as root) crontab -e to create the different jobs, and when saving it seems to go fine. The /var/log/cron is updated like this:

nov 10 14:12:27 mumin crontab[2802]: (root) BEGIN EDIT (root)
nov 10 14:12:33 mumin crontab[2802]: (root) END EDIT (root)

And if I do crontab -l I get this:

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.29909 installed on Mon Nov 10 12:03:32 2003)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
* * * * * /root/du_script.perl >> /root/my_cron.log

So, the du_script.perl should be run every minute, but nothing happens.

So I tried to create a crontab for another user, and that works perfectly.

crontab -l (as David)

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.3222 installed on Mon Nov 10 14:24:45 2003)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
* * * * * /home/David/david_crontest.perl >> /home/David/cron.log

and in the cron log:

nov 10 14:24:09 mumin crontab[3222]: (David) BEGIN EDIT (David)
nov 10 14:24:45 mumin crontab[3222]: (David) REPLACE (David)
nov 10 14:24:45 mumin crontab[3222]: (David) END EDIT (David)
nov 10 14:24:53 mumin crontab[3251]: (David) LIST (David)
Nov 10 14:25:00 mumin crond[26585]: (David) RELOAD (cron/David)
Nov 10 14:25:00 mumin CROND[3253]: (David) CMD (/home/David/david_crontest.perl >> /home/David/cron.log)

Why is nothing happening for the root's cron jobs? I would appreciate any tips helping me sort this out!!

Old 11-10-2003, 07:33 AM   #2
Registered: Aug 2003
Location: Portland, Oregon
Distribution: RedHat, Libranet
Posts: 438

Rep: Reputation: 30
Login as root and verify that your script runs as expected. If you su to root, make sure you use "su -".
Old 11-10-2003, 07:57 AM   #3
LQ Newbie
Registered: Nov 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Hmm. Well I was logged in as root, and the scripts run as they should. Am a bit confused again, since it seems the crontab suddenly "kicked in" and started working. Don't know what happend, but I did nothing I haven't already done... Spooky. Will get back if starts giving me trouble again!

Thanks so far!



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
crontab as root nutthick Linux - Newbie 2 03-03-2005 02:13 AM
cannot use crontab as root???? rnj Linux - Software 2 10-24-2004 10:24 AM
Crontab "root user" problems... Clubber Lang Linux - General 3 09-30-2004 09:29 AM
root crontab plisken Slackware 8 05-02-2004 11:41 AM
How to restore original root crontab vrillusions Slackware 1 04-21-2004 09:54 PM

All times are GMT -5. The time now is 04:28 PM.

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