crond running command multiple times

View: New views
2 Messages — Rating Filter:   Alert me  

crond running command multiple times

by bcbob43 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am running unslung 6.10 and I am trying to run a command at a specified time.

1. I edited /etc/crontab as a test to run date and append the output to a log file /tmp/datlog. The crontab file contains:
# cat /etc/crontab
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""
HOME=/
# ---------- ---------- Default is Empty ---------- ---------- #
0 0-23/8 * * * root /usr/sbin/CheckDiskFull &>/dev/null
0 0 * * * root /usr/sbin/WatchDog &>/dev/null
32 * * * * root /bin/date>>/tmp/datlog
36 * * * * root /bin/date>>/tmp/datlog

2. When I look at /tmp/datlog, I get (the first line is when I ran the command manually to test it)
# cat /tmp/datlog
Sat Aug 29 16:28:21 CDT 2009
Sat Aug 29 16:31:59 CDT 2009
Sat Aug 29 16:31:59 CDT 2009
Sat Aug 29 16:32:00 CDT 2009
Sat Aug 29 16:32:00 CDT 2009
Sat Aug 29 16:32:00 CDT 2009
Sat Aug 29 16:32:00 CDT 2009
Sat Aug 29 16:35:59 CDT 2009
Sat Aug 29 16:35:59 CDT 2009
Sat Aug 29 16:35:59 CDT 2009
Sat Aug 29 16:36:00 CDT 2009
Sat Aug 29 16:36:00 CDT 2009
Sat Aug 29 16:36:00 CDT 2009

3. I noticed that there are multiple cron processes running:
# ps | grep cron*
  395 root        564 S   /usr/sbin/crond
  566 root        564 S N /usr/sbin/crond -help
  568 root        564 S N /usr/sbin/crond -l
  636 root        564 S N crond
  651 root        564 S N crond -l
  653 root        564 S N crond -help
  997 root        424 S N grep cron*

Any ideas what is going on?

TIA

Bob

Re: crond running command multiple times

by Marcel Nijenhof :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 2009-08-29 at 14:56 -0700, bcbob43 wrote:

> 3. I noticed that there are multiple cron processes running:
> # ps | grep cron*
>   395 root        564 S   /usr/sbin/crond
>   566 root        564 S N /usr/sbin/crond -help
>   568 root        564 S N /usr/sbin/crond -l
>   636 root        564 S N crond
>   651 root        564 S N crond -l
>   653 root        564 S N crond -help
>   997 root        424 S N grep cron*
>
> Any ideas what is going on?

It looks like you tested how the crond command worked.
Unfortunately it didn't work like you expected and for instance
"crond -help" just started a new cron daemon.

--
Marcel Nijenhof
Optware package developer
nslu2@...