From owner-freebsd-questions@freebsd.org Sat Mar 5 04:10:34 2016 Return-Path: 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 0762B9DAC9E for ; Sat, 5 Mar 2016 04:10:34 +0000 (UTC) (envelope-from matt@gsicomp.on.ca) Received: from salamander.gsicomp.on.ca (salamander.gsicomp.on.ca [162.243.98.91]) by mx1.freebsd.org (Postfix) with ESMTP id DABE9A93 for ; Sat, 5 Mar 2016 04:10:33 +0000 (UTC) (envelope-from matt@gsicomp.on.ca) Received: from HEXEN (ip-104-193-58-36.user.start.ca [104.193.58.36]) by salamander.gsicomp.on.ca (Postfix) with ESMTPA id 3F5C442087; Fri, 4 Mar 2016 23:03:05 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gsicomp.on.ca; s=mail; t=1457150585; bh=B7xV7MiQzXq76i+KXK9534ZulVXHMIzLBFs7BDjshQs=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=nVGCqvF7sq5EoCXU9neW7I5elBwwtwtw8LBHXT+nmpu+3IiWS5A72Nf4mYSiBMX1b khvSqRTIu12ihw8GeT/64Xm1xYD+HPSqO+TNBj1Uc0jllSJEK2MZQTaOXYZZKHyAsb qNvjlVMUJrP9fubBK+Zus6wXZyILXsGlikFOleY4= From: "Matt Emmerton" To: "'gahn'" Cc: References: <430270708.3017333.1457136683088.JavaMail.yahoo.ref@mail.yahoo.com> <430270708.3017333.1457136683088.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <430270708.3017333.1457136683088.JavaMail.yahoo@mail.yahoo.com> Subject: RE: crontab is not working Date: Fri, 4 Mar 2016 23:02:54 -0500 Message-ID: <047b01d17693$e5151810$af3f4830$@on.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdF2c5aTSLStJ1VgQpKfLedoJOzajQAIAJew Content-Language: en-us X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Mar 2016 04:10:34 -0000 > -----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" 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