Date: Sat, 5 Mar 2016 04:33:37 +0000 (UTC) From: gahn <ipfreak@yahoo.com> To: Matt Emmerton <matt@gsicomp.on.ca> Cc: "freebsd-questions@FreeBSD.org" <freebsd-questions@FreeBSD.org> Subject: Re: crontab is not working Message-ID: <1539211206.3089370.1457152417778.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <047b01d17693$e5151810$af3f4830$@on.ca> References: <047b01d17693$e5151810$af3f4830$@on.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
thanks matt: yes i did remove that "root", but it still a no go. nothing happened. run t= hat script manually with "bash /root/snmpwalk.sh" with no issues. i am puzzled. =20 On Friday, March 4, 2016 11:03 PM, Matt Emmerton <matt@gsicomp.on.ca> w= rote: =20 > -----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=C2=A0 =C2=A0 *=C2=A0 =C2=A0 *=C2=A0 =C2=A0 *=C2=A0 =C2=A0 *=C2=A0 =C2= =A0 root=C2=A0 =C2=A0 /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=C2=A0 4 15:22:00 snails /usr/sbin/cron[88515]: (operator) CMD (/usr/l= ibexec/save-entropy) Mar=C2=A0 4 15:22:00 > snails /usr/sbin/cron[88516]: (root) CMD (root^I/root/snmpwalk.sh) Mar=C2= =A0 4 15:23:00 snails /usr/sbin/cron[88531]: > (root) CMD (root^I/root/snmpwalk.sh) Mar=C2=A0 4 15:24:00 snails /usr/sbi= n/cron[88534]: (root) CMD (root^I/root/snmpwalk.sh) > > thanks. Get rid of the "root<tab>" in the crontab entry.=C2=A0 The username is impl= icit and doesn't need to be specified.=C2=A0 cron is treating that as part of the command which is why it's failing to run. Regards, -- Matt Emmerton From owner-freebsd-questions@freebsd.org Sat Mar 5 04:57:47 2016 Return-Path: <owner-freebsd-questions@freebsd.org> Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 132D7A09D50 for <freebsd-questions@mailman.ysv.freebsd.org>; Sat, 5 Mar 2016 04:57:47 +0000 (UTC) (envelope-from benfell@parts-unknown.org) Received: from mail.parts-unknown.org (n4rky-1-pt.tunnel.tserv29.fmt1.ipv6.he.net [IPv6:2001:470:66:119::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01B30100 for <freebsd-questions@freebsd.org>; Sat, 5 Mar 2016 04:57:46 +0000 (UTC) (envelope-from benfell@parts-unknown.org) Received: from [192.168.1.75] (unknown [50.250.218.173]) by mail.parts-unknown.org (Postfix) with ESMTPSA id AC3A35951E97 for <freebsd-questions@freebsd.org>; Fri, 4 Mar 2016 20:57:40 -0800 (PST) Subject: Re: crontab is not working To: freebsd-questions@freebsd.org References: <047b01d17693$e5151810$af3f4830$@on.ca> <1539211206.3089370.1457152417778.JavaMail.yahoo@mail.yahoo.com> From: David Benfell <benfell@parts-unknown.org> Message-ID: <56DA6743.8000100@parts-unknown.org> Date: Fri, 4 Mar 2016 20:57:39 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1539211206.3089370.1457152417778.JavaMail.yahoo@mail.yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions <freebsd-questions.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/> List-Post: <mailto:freebsd-questions@freebsd.org> List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 05 Mar 2016 04:57:47 -0000 On 03/04/2016 08:33 PM, gahn via freebsd-questions wrote: > thanks matt: > 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. But the logs will surely say something different. Matt was right. You were using the cron.daily/weekly/monthly format where a (different) crontab format is called for. -- David Benfell, Ph.D. benfell@parts-unknown.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1539211206.3089370.1457152417778.JavaMail.yahoo>