Date: Fri, 4 Mar 2016 23:02:54 -0500 From: "Matt Emmerton" <matt@gsicomp.on.ca> To: "'gahn'" <ipfreak@yahoo.com> Cc: <freebsd-questions@FreeBSD.org> Subject: RE: crontab is not working Message-ID: <047b01d17693$e5151810$af3f4830$@on.ca> In-Reply-To: <430270708.3017333.1457136683088.JavaMail.yahoo@mail.yahoo.com> References: <430270708.3017333.1457136683088.JavaMail.yahoo.ref@mail.yahoo.com> <430270708.3017333.1457136683088.JavaMail.yahoo@mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> -----Original Message----- > From: owner-freebsd-questions@freebsd.org = [mailto:owner-freebsd-questions@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?047b01d17693$e5151810$af3f4830$>