crontab is not working

Matt Emmerton matt at gsicomp.on.ca
Sat Mar 5 04:10:34 UTC 2016


> -----Original Message-----
> From: owner-freebsd-questions at freebsd.org [mailto:owner-freebsd-questions at freebsd.org] On Behalf Of gahn via freebsd-questions
> Sent: Friday, March 04, 2016 7:11 PM
> To: Freebsd General Questions
> Subject: crontab is not working
>
> hi:
> i am trying to test a crontab job for snmpwalk but it is not working:
> here is crontab:
> */1    *    *    *    *    root    /root/snmpwalk.sh
>
> for the script, it is very simple:
> #!/usr/local/bin/bash
>
> /usr/local/bin/snmpwalk -v 2c -c public 100.10.10.10
>
> from the log, i can see this
>
> Mar  4 15:22:00 snails /usr/sbin/cron[88515]: (operator) CMD (/usr/libexec/save-entropy) Mar  4 15:22:00
> snails /usr/sbin/cron[88516]: (root) CMD (root^I/root/snmpwalk.sh) Mar  4 15:23:00 snails /usr/sbin/cron[88531]:
> (root) CMD (root^I/root/snmpwalk.sh) Mar  4 15:24:00 snails /usr/sbin/cron[88534]: (root) CMD (root^I/root/snmpwalk.sh)
>
> thanks.

Get rid of the "root<tab>" in the crontab entry.  The username is implicit and doesn't need to be specified.  cron is treating
that as part of the command which is why it's failing to run.

Regards,
--
Matt Emmerton





More information about the freebsd-questions mailing list