crontab is not working
ipfreak at yahoo.com
Sat Mar 5 04:36:42 UTC 2016
yes i did remove that "root", but it still a no go. nothing happened. run that script manually with "bash /root/snmpwalk.sh" with no issues.
i am puzzled.
On Friday, March 4, 2016 11:03 PM, Matt Emmerton <matt at gsicomp.on.ca> wrote:
> -----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
> 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/snmpwalk -v 2c -c public 188.8.131.52
> from the log, i can see this
> Mar 4 15:22:00 snails /usr/sbin/cron: (operator) CMD (/usr/libexec/save-entropy) Mar 4 15:22:00
> snails /usr/sbin/cron: (root) CMD (root^I/root/snmpwalk.sh) Mar 4 15:23:00 snails /usr/sbin/cron:
> (root) CMD (root^I/root/snmpwalk.sh) Mar 4 15:24:00 snails /usr/sbin/cron: (root) CMD (root^I/root/snmpwalk.sh)
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.
More information about the freebsd-questions