PDA

View Full Version : Cron: how to?


cali
01-27-2003, 12:08 PM
hola!


Just did the 3.1 upgrade, and added a few toys I never used before. Everything went fine, but now I need some help.

How do I activate cron? Does it automatically run once installed?
How can I add/edit/delete stuff to it?

A search didn't reveal anythign concrete, and the readme is just install directions.

Cali

JJBliss
01-27-2003, 12:26 PM
If you loaded cron with one of the 3.1Tivolater modules, then yes, it starts automatically after a reboot.

You can check this by typing "ps aux" (no quotes) at the bash prompt and see if cron is running.

If you see it on the left side of the screen (scroll back in your emulator to see if you missed it), then it's running. If it's not there, you should be able to start it by just typing "cron" at the bash prompt. For the future, however, you'll need to add it to the /etc/rc.d/rc.remote-login script yourself so it comes back after a reboot automatically.

You'll also need to edit the /etc/crontab file. In here, you can schedule jobs to run as needed.

For a more detailed review of crontab editing and concepts, you can look here (http://www.uwsg.iu.edu/usail/automation/cron.html) , or do a web search for crontab editing.

the crontab file itself, has some lite documentation in it. There isn't much to it really.

cali
01-27-2003, 07:05 PM
Useful info, and to the point!

Will read up now and try it when I get home!

cali
01-28-2003, 12:29 PM
When I reboot and do a ps aux, i see cron in there..although I didnt set it up in the rc.remote file....does that mean during install is was set-up to run all the time?

I edited the crontab file with joe.

Is this correct?

00 4 * * * /var/hack/runthis.tcl

Run runthis.tcl @ 4AM everyday? Do I need to specify user as root?

One other thing....how can I verify that cron is indeed doing what its supposed to?

JJBliss
01-28-2003, 01:43 PM
Originally posted by cali
When I reboot and do a ps aux, i see cron in there..although I didnt set it up in the rc.remote file....does that mean during install is was set-up to run all the time?

I edited the crontab file with joe.

Is this correct?

00 4 * * * /var/hack/runthis.tcl

Run runthis.tcl @ 4AM everyday? Do I need to specify user as root?

One other thing....how can I verify that cron is indeed doing what its supposed to?

As long as you see cron running in ps aux immediately AFTER a reboot, yes, it's was setup at installation.

I would use:

* 4 * * * /var/hack/runthis.tcl

There is no option for '00' as a time. It is 01 - 59

To verify that cron is doing something, run the
date >> /var/hack/cron.test.out command that was in cron to start with every ten minutes. Check the /var/hack directory for the output file, and read it.

This will prove that cron is properly scheduling jobs. Once you prove that, it's up to your own editing to keep it working.


JJ