# cron entries won't run



## scottemick (Mar 11, 2010)

I am somewhat new to FreeBSD, but not to Unix, Linux, or Servers.  I read the directions on here for cron, and it said I could edit the /etc/crontab with my favorite editor and save (logged in as root), and it would recognize the changes automatically.  Well it did not.  

I found another web page that said to use crontab -e.  That did work after I did a crontab -R.  I then pasted my entries into the file and did a ctrl-x and saved the thing.  

I restarted the cron daemon, and tailed the log, but I am seeing 2 major problems:
1.  Orphan (no passwd entry)
2.  What appears to be two different time zones in my log!



```
Mar 11 06:57:00 webserver001 /usr/sbin/cron[1733]: (tmp.18184) ORPHAN (no passwd entry)
Mar 11 06:57:00 webserver001 /usr/sbin/cron[1733]: (root) RELOAD (tabs/root)
Mar 11 09:58:39 webserver001 /usr/sbin/cron[8314]: (*system*) PARSE (bad username)
Mar 11 09:58:39 webserver001 /usr/sbin/cron[8314]: login_getclass: unknown class 'optimize1.pl  #'
Mar 11 09:58:39 webserver001 /usr/sbin/cron[8314]: (*system*) PARSE (bad username)
Mar 11 09:58:39 webserver001 /usr/sbin/cron[8314]: login_getclass: unknown class 'race_gen1.pl  #'
Mar 11 09:58:39 webserver001 /usr/sbin/cron[8314]: (*system*) PARSE (bad username)
Mar 11 09:58:39 webserver001 /usr/sbin/cron[8314]: login_getclass: unknown class 'clean1.pl  #'
Mar 11 09:58:39 webserver001 /usr/sbin/cron[8314]: (*system*) PARSE (bad username)
Mar 11 09:58:39 webserver001 /usr/sbin/cron[8314]: login_getclass: unknown class 'update_ship1.pl  #'
Mar 11 09:58:39 webserver001 /usr/sbin/cron[8314]: (*system*) PARSE (bad username)
Mar 11 09:58:39 webserver001 /usr/sbin/cron[8314]: (tmp.18184) ORPHAN (no passwd entry)
```

some of my log...

here is the crontab itself:

```
# /etc/crontab - root's crontab for FreeBSD
# edited 03/11/2010
#
# $FreeBSD: src/etc/crontab,v 1.32 2002/11/22 16:13:39 tom Exp $
#
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour    mday    month   wday    who     command
#
*/5     *       *       *       *       root    /usr/libexec/atrun
#
# Save some entropy so that /dev/random can re-seed on boot.
*/11    *       *       *       *       operator /usr/libexec/save-entropy
#
# Rotate log files every hour, if necessary.
0       *       *       *       *       root    newsyslog
#
# Perform daily/weekly/monthly maintenance.
1       3       *       *       *       root    periodic daily
15      4       *       *       6       root    periodic weekly
30      5       1       *       *       root    periodic monthly
#
# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time.  See adjkerntz(8) for details.
1,31    0-5     *       *       *       root    adjkerntz -a
# Feature Update - updates Featured Product db with new releases
0 3 * * * /export/home0/vhost218/tasks/feature_update.pl

# optimize - optimizes database
30 3 * * * /export/home/0/vhost218/tasks/optimize1.pl

# race generate
0 4 * * 1 /export/home0/host218/tasks/race_gen1.pl

# Orders Cleanup - deletes old initiated orders
0 5 1 * * /export/home0/vhost218/tasks/clean1.pl

# Update Shipped Products - updates orders shipped and notifies customer
36 09 * * * /export/home0/vhost218/tasks/update_ship1.pl
```
I also made sure all scripts can run on their own and have execute permissions etc.

Any help greatly appreciated,
Thanks,
Scott Emick


----------



## DutchDaemon (Mar 11, 2010)

Don't edit /etc/crontab, it's the system crontab that may get overwritten by a system upgrade. Use the user's crontab, e.g. [cmd=]crontab -e[/cmd] as root, or [cmd=]crontab -e -u someuser[/cmd] for a user's crontab. Note: /etc/crontab has a different format: it requires 'the user to run as' as the sixth field. Users' crontabs obviously don't need that. _Use the latter._


----------



## scottemick (Mar 11, 2010)

Thanks I didn't even notice the missing root on the entries I copied from the other FreeBSD server...


----------

