# Cron Help Please



## emh_alpha1 (Oct 22, 2002)

First time using CRON - downloaded Cronnix and setup cron task to run.  Nothing happened when the set time rolled around.  Found some documentation - suggested checking process to see if Cron was running.  Does not appear to be.  How do I enable cron?  I'm running 10.2.1.  Is this yet another thing that 10.2 disables?

Thanks in advance.

EMH.


----------



## jwalk76 (Oct 22, 2002)

ps -ax | grep cron

will tell you if the daemon is running.  unfortunately, i'm only running 10.1.5, so i'm not sure if your installation is different.  i can say that i don't think they would remove cron from the default install as it's highly useful.

###### to test if cron works make a simple script called test.sh:

     #!/bin/sh
     ps -ax > /Users/your_user_name/testresults

###### set the right permissions on the script:

     chmod 700 /Users/your_user_name/test.sh

###### open your crontab with:

     crontab -e

###### once your editor launches type this:

     *     *     *     *     *     /Users/your_user_name/test.sh

once the system clock ticks forward a minute check your home directory for the testresults file that should contain the output of the command ps -ax.  don't forget to disable the cron job when your done testing.


----------



## emh_alpha1 (Oct 22, 2002)

thanks for your quick response.

i tried everything you suggested, but still no results.
[USS-Voyager-NCC-74656:~] mthomson% ps -ax |grep cron
  321  ??  Ss     0:00.03 cron
  507 std  UV+    0:00.12 grep cron

so it looks like grep is running.

set up the script as you instructed and set the crontab but still doesn't generate the testresults doc no matter how long you wait.  if i run test.sh manually it works fine and generates the output.  so cron is still letting the side down?

any other ideas?

EMH


----------



## emh_alpha1 (Oct 23, 2002)

okay got it - it's working now.  it won't acknowledge the changes in the crontab until you log out and back in again.  is there anyway to force it to update/reload besides logging in and out?

Thanks

EMH


----------



## jwalk76 (Oct 23, 2002)

i don't know.  i've never had that problem.  my cron jobs have always been updated instantly.  good luck.


----------



## michaelsanford (Oct 25, 2002)

You can make the crontab reload by killing it and restarting it with the following. First, you find out where cron is (/usr/sbin/cron), then get the PID of cron, then kill it, then restart it. That should reload the changed crontab. Note that you'll need sudo for everything except `ps`.


```
Welcome to Helios;
*AUTHORIZED PERSONNEL ONLY*

Fri Oct 25 21:09:02 EDT 2002
 9:09PM  up 1 day,  6:47, 2 users, load averages: 1.32, 0.77, 0.67
No new messages.
No mail for gwailo
[gwailo:~]% which cron
/usr/sbin/cron

[gwailo:~]% ps -ax | grep cron
  312  ??  Ss     0:00.37 cron
  568 std  R+     0:00.01 grep cron

[gwailo:~]% sudo kill 312
Password:

[gwailo:~]% sudo /usr/sbin/cron
[gwailo:~]%

[gwailo:~]% ps -ax | grp cron

OK? ps -ax | grep cron? yes
  573  ??  Ss     0:00.02 /usr/sbin/cron
  575 std  R+     0:00.00 grep cron
```

Just remember that there's a lot of system stuff set up as cronjobs, so if you can't get it to work, I'd restart your comuter just to make sure it's running.

HTH


----------



## dani++ (Oct 26, 2002)

Same here. I have never heard of the cron process to be restarted to accept new changes. Something is wrong in the procedure you are using.


dani


----------



## michaelsanford (Oct 26, 2002)

Yeah I  should hvae mentioned that too, I've never had to restart it...


----------

