From owner-freebsd-questions@FreeBSD.ORG Wed Jul 18 02:33:23 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6DCC16A403 for ; Wed, 18 Jul 2007 02:33:23 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) by mx1.freebsd.org (Postfix) with ESMTP id 5A2FE13C4A8 for ; Wed, 18 Jul 2007 02:33:23 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from banyan.cs.ait.ac.th (banyan.cs.ait.ac.th [192.41.170.5]) by mail.cs.ait.ac.th (8.13.1/8.12.11) with ESMTP id l6I2XLKN088079 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Jul 2007 09:33:21 +0700 (ICT) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.13.3/8.12.11) id l6I2XJrw097658; Wed, 18 Jul 2007 09:33:19 +0700 (ICT) Date: Wed, 18 Jul 2007 09:33:19 +0700 (ICT) Message-Id: <200707180233.l6I2XJrw097658@banyan.cs.ait.ac.th> From: Olivier Nicole To: youshi10@u.washington.edu In-reply-to: <469AFA30.4050504@u.washington.edu> (message from Garrett Cooper on Sun, 15 Jul 2007 21:55:12 -0700) References: <000f01c7c56d$da44d640$0200a8c0@satellite> <200707160427.l6G4Rb5q090225@banyan.cs.ait.ac.th> <469AFA30.4050504@u.washington.edu> X-Virus-Scanned: on CSIM by amavisd-milter (http://www.amavis.org/) Cc: dmehler26@woh.rr.com, freebsd-questions@freebsd.org Subject: Re: cron job every 5 hours X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2007 02:33:23 -0000 > Something like: > > minute */5 * * * root path/to/scriptname > > will do the trick. > > Substitute the * in */5 for your desired start time (* being 0). > > -Garrett > > PS crond won't do 5 hours and every x number of minutes per job (5 hours > + x mins from end to start), just a flat amount of time (5 hours apart > from start to start). If you need that type of 'precision', at will > solve that like Olivier said if you place it at the end of the command. I am afraid not. */5 means on every hours that is a multiple of 5, not every five hours. So it will run every day at hour 0, 5, 10, 15 and 20. Between hour 20 one day and hour 0 the next day there is only 4 hours, not the "every 5 hours" requested. Just to confirm that I launched a cron job yesterday: 23 */5 * * * /home/java/on/crontest It ran at 15:23, 20:23 and today at 0:23 and 5:23 and so on: Date: Wed, 18 Jul 2007 05:23:00 +0700 (ICT) From: Olivier Nicole To: on@banyan.cs.ait.ac.th Subject: test crontab 5 hours X-Virus-Scanned: on CSIM by amavisd-milter (http://www.amavis.org/) This is a test for crontab Only way to run a job every 5 hours is with at(1). Best regards, Olivier