From owner-freebsd-questions@FreeBSD.ORG Mon Jul 16 04:27:41 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 C099B16A402 for ; Mon, 16 Jul 2007 04:27:41 +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 45A4B13C4C7 for ; Mon, 16 Jul 2007 04:27:40 +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 l6G4Rd8X000411 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Jul 2007 11:27:39 +0700 (ICT) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.13.3/8.12.11) id l6G4Rb5q090225; Mon, 16 Jul 2007 11:27:37 +0700 (ICT) Date: Mon, 16 Jul 2007 11:27:37 +0700 (ICT) Message-Id: <200707160427.l6G4Rb5q090225@banyan.cs.ait.ac.th> From: Olivier Nicole To: dmehler26@woh.rr.com In-reply-to: <000f01c7c56d$da44d640$0200a8c0@satellite> (dmehler26@woh.rr.com) References: <000f01c7c56d$da44d640$0200a8c0@satellite> X-Virus-Scanned: on CSIM by amavisd-milter (http://www.amavis.org/) Cc: 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: Mon, 16 Jul 2007 04:27:41 -0000 > I want to run an updater script, every 5 hours and x minutes. I thought > to use: > > minute 5 * * * root path/to/scriptname > > but that looks like it only works once a day, i want it to go every 5 hours > not justa at 5 in the monrning. You could sechedule you jor at 5, 10, 15 and 20 on monday, then 1, 6, 11, 16 and 21 on Tuesday and etc, but as the number of hours per week is not a multiple of 5, next week Monday would be at 2, 7, 12, 17 and 22, and that would not work with cron. If you absolutely need it to be 5 hours (6 hours would work nicely with cron) have your job restart itself with at(1). Cron must work on a weekly sechedule. bests, Olivier