1834264 Members
84075 Online
110066 Solutions
New Discussion

Re: Crontab

 
SOLVED
Go to solution
Dave Hartman
Occasional Contributor

Crontab

Hi,
I'm trying to get some scripts to run using crontab. I've used the command "crontab -e" to make changes to the file.

I added something simple like:
49 10 * * * echo "Its working finally"

while logged in as root, but nothing seems to happen.
Do you have to restart the machine for the changes in crontab to work properly or is their something I'm doing wrong.
(Was trying to echo at 10:49am)
4 REPLIES 4
Joel Shank
Valued Contributor
Solution

Re: Crontab

Hi Dave
I do it a little differently. First I save the current crontab using the command:
crontab -l > cronfile
Then I edit cronfile, adding/changing whatever you want.
Then put it back:
crontab cronfile
This has always worked for me.
Joel
Dave Hartman
Occasional Contributor

Re: Crontab

Joel,
Thanks, it works fine now. Otherwise it looks like you have to reboot.
jherring
Regular Advisor

Re: Crontab

Using crontab -e is the recommended way to use cron.

try the following

* * * * * /usr/bin/date > /dev/console

every minute run the date command and display it to the console.

This will at least test to see if cron is working

You may also want to check cron.allow and cron.deny files
see man crontab for more info.


John_Hancock
Trusted Contributor

Re: Crontab

Dave, a reboot is not required. cron rereads the crontab file once a minute.

We also use rcs (see the man page) to track changes to the crontab file.

John Hancock