# /etc/crontab not work on root



## Limbo (Apr 8, 2017)

Day Sirs!

Please help me with crontab on my FreeBSD 11 system,

I login with root and needs to make this crontab job:


```
# /etc/crontab - root's crontab for FreeBSD
#
# $FreeBSD$
# 1
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin 2
#
#minute    hour    mday    month    wday    who    command 3
#
*/11    *    *    *    *    operator /usr/libexec/save-entropy
*/5    *    *    *    *    root    /usr/libexec/atrun
1    3    *    *    *    root    periodic daily
15    4    *    *    6    root    periodic weekly
30    5    1    *    *    root    periodic monthly
1,31    0-5    *    *    *    root    adjkerntz -a
*       *       */1     *       *       root    mysqldump -u root -pmasterMYSQL CBM | gzip> /usr/local/www/CBM_`date +%m-%d-%Y`.sql.gz
*       *       *       */1     *       root    rm /usr/local/www/*.*
```

Shield not work please help.

Kind regards,
from Russland


----------



## Purkuapas (Apr 9, 2017)

Limbo said:


> PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin 2
> ..
> *       *       */1     *       *       root    mysqldump -u root -pmasterMYSQL CBM | gzip> /usr/local/www/CBM_`date +%m-%d-%Y`.sql.gz
> ..



Is it a typo or do you really have the  '* 2*' in PATH string ? Please delete this number.
Also, mysqldump not in PATH here. Try to expand the PATH variable to:


```
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
```


----------



## ShelLuser (Apr 10, 2017)

Apart from the above messages also _always_ check your (local) e-mail. The output of the system cronjobs is send by e-mail to root, so I'm fairly certain that you'll find the exact problem mentioned in there as well. Maybe time to check /var/mail before your file system starts filling up?


----------



## borsti007 (Apr 19, 2017)

The "who" field does only exist in the system crontab:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-cron.html


Under root is the "who" field already the "command" field.


----------



## ShelLuser (Apr 19, 2017)

borsti007 said:


> The "who" field does only exist in the system crontab


Which is what he seems to be editing: /etc/crontab, also see the comment section in his code snippet.

But if he isn't then you solved it


----------

