From owner-freebsd-questions@freebsd.org Sat Mar 5 04:36:42 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 0A966A0968A for ; Sat, 5 Mar 2016 04:36:42 +0000 (UTC) (envelope-from ipfreak@yahoo.com) Received: from nm4-vm2.bullet.mail.ne1.yahoo.com (nm4-vm2.bullet.mail.ne1.yahoo.com [98.138.90.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D43E6A46 for ; Sat, 5 Mar 2016 04:36:41 +0000 (UTC) (envelope-from ipfreak@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1457152418; bh=Oqne/55NitcwcQI+FA9ZAmHlZcNADwZp1EKgDNUJ2M0=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=BkC2Q5hFZYIs3DjhGlJvsalOpBJ/DjZvUrnKRT/Rh+Kw77dNSKyC3LM7RMRKZjBAm0pNSeFTGIRMkXZrsk+JrkaeQMLr8Wht3/w0hABWVZ/3eD2PpcqBEMYoW3ByI5BH1ewUurKSugqRiHH6vPHtIjgksclNSWiN56fyLkvHj0e771V/FOrPDgbSHyV4yJmR2qAVOEaxmiHcQ/BghkDcJWMXdm1P93uunwKGQeS0nZajHSRyKMs0Wc7IU6hv0fMF+o5I8USs43W3SbND71nEPMHGgBEq7qgW2raEtVIu8b0zMQmFI8zUY2S5PQWui9hMF5d70Z+EBEy8avwDhU1Z5A== Received: from [98.138.100.117] by nm4.bullet.mail.ne1.yahoo.com with NNFMP; 05 Mar 2016 04:33:38 -0000 Received: from [98.138.87.11] by tm108.bullet.mail.ne1.yahoo.com with NNFMP; 05 Mar 2016 04:33:38 -0000 Received: from [127.0.0.1] by omp1011.mail.ne1.yahoo.com with NNFMP; 05 Mar 2016 04:33:38 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 570331.51864.bm@omp1011.mail.ne1.yahoo.com X-YMail-OSG: Ljl_PVQVM1kZ47ip2nYLQVMRx.R0LNm4tbAuimpT1xciNPWYnNDfOo9bMDH_xOt MGx3TJm6DghoSoiuY8UUSkysTOE2PwIhUqA0StzqbkCt3Rp4E1dptmqOSV7zpvAmBztD7VVbuh33 ovaD2XfA1iUqjuhyJ5Meeh1nkXVHXGeG80XYkiAPmOnQrDxeos2nOKLdnviX0.kzEoy6pvicSFYz UdS9VMikkVVNv0n8JBi7sxLQ4WNMicRwo0mi8fv5paZoqg0mC1vRlfrs0f_VyT0qJSyFCxC9orrR 3BuJbeZRZ6QgxN3JPjPqKc03amdkkJ8mAky1oLgSPbAjHFfRG_EZEud0Vu_1w9ngFXUBMXPPNOHG JJSdZBDS5lyisPlQUP0omHAYGC_T1S3MKIhi6nyFDPfADgIfX3TJbcJ9d0SsNIkWL9uXo6X7yQra TuHc0tIz8TR6sBGEnlPsIPRWAplk7DTJBoNjGWnna4CWaBajeL0_eK7uugF1va7K4DzlyzhiGq3X 0JaAESw-- Received: by 98.138.105.253; Sat, 05 Mar 2016 04:33:38 +0000 Date: Sat, 5 Mar 2016 04:33:37 +0000 (UTC) From: gahn Reply-To: gahn To: Matt Emmerton Cc: "freebsd-questions@FreeBSD.org" Message-ID: <1539211206.3089370.1457152417778.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <047b01d17693$e5151810$af3f4830$@on.ca> References: <047b01d17693$e5151810$af3f4830$@on.ca> Subject: Re: crontab is not working MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:36:42 -0000 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 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" 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: 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 ; 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 ; 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 ; 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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