From owner-freebsd-questions Thu May 4 20:50:23 2000 Delivered-To: freebsd-questions@freebsd.org Received: from iserver.itworks.com.au (iserver.itworks.com.au [203.32.61.10]) by hub.freebsd.org (Postfix) with SMTP id 9AEB137B598 for ; Thu, 4 May 2000 20:50:01 -0700 (PDT) (envelope-from rgrace@itworks.com.au) Received: (qmail 95978 invoked from network); 5 May 2000 03:49:54 -0000 Received: from maybe.itworks.com.au (203.36.209.235) by iserver.itworks.com.au with SMTP; 5 May 2000 03:49:54 -0000 Received: (qmail 28775 invoked from network); 5 May 2000 03:49:54 -0000 Received: from dhcp8.itworks.com.au (HELO paranoia) (203.36.209.217) by maybe.itworks.com.au with SMTP; 5 May 2000 03:49:54 -0000 Reply-To: From: "Richard Grace" To: "Jonathan Chen" , "Doug Young" Cc: Subject: RE: "bad day_of_the_month" (yes really !!!) cron questions Date: Fri, 5 May 2000 13:52:23 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 In-Reply-To: <20000505145429.B798@jonc.itouch.co.nz> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Hang on there, you've just attached a binary executable! I hope you're > not trying to feed *that* to crontab(1). You need to have a file having > the contents with something like: > > # > # Personal crontab > # > # Environment > > PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin: > /home/jonc/bin > # > #Min Hr MnDy Month WkDy Command > */5 6-20 * * * fetchmail --silent > > /dev/null 2>&1 > > and feed that file to crontab(1). Yep, or 'crontab -e' will let you edit your crontab using $EDITOR. There are also environment variables for each crontab, here's one I use to run scripts... --- cut here --- # Richard's experimental snmp code SHELL=/bin/sh MAILTO=rgrace@itworks.com.au 40 * * * * /home/rgrace/port-acct/port-acct.pl 2>&1 --- cut here --- This runs a script at 40 mins past the hour, using /bin/sh and sends the stdout and stderr to me via email. I have a .forward file which then sends the mail to other relevant people. Have fun with cron... Richard Grace To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message