From owner-freebsd-questions@FreeBSD.ORG Tue Mar 31 07:56:17 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D27FB1065670 for ; Tue, 31 Mar 2009 07:56:17 +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 52CD28FC19 for ; Tue, 31 Mar 2009 07:56:16 +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.13.1) with ESMTP id n2V7qKWB047377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 31 Mar 2009 14:52:20 +0700 (ICT) (envelope-from on@banyan.cs.ait.ac.th) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.14.2/8.12.11) id n2V7uEk7075938; Tue, 31 Mar 2009 14:56:14 +0700 (ICT) Date: Tue, 31 Mar 2009 14:56:14 +0700 (ICT) Message-Id: <200903310756.n2V7uEk7075938@banyan.cs.ait.ac.th> From: Olivier Nicole To: mel.flynn+fbsd.questions@mailing.thruhere.net In-reply-to: <200903310659.31371.mel.flynn+fbsd.questions@mailing.thruhere.net> (message from Mel Flynn on Tue, 31 Mar 2009 06:59:31 +0200) References: <200903310452.n2V4qTXk091526@banyan.cs.ait.ac.th> <200903310659.31371.mel.flynn+fbsd.questions@mailing.thruhere.net> X-Virus-Scanned: on CSIM by amavisd-milter (http://www.amavis.org/) Cc: freebsd-questions@freebsd.org Subject: Re: Crontab for different ime zones 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: Tue, 31 Mar 2009 07:56:18 -0000 > > Is there a way to start jobs with cron using different a time-zone > > different from local time zone? > > > > I am in a TZ that has no Daylight Savings Time, and would like to > > start a job (reccording of a web cast) in a TZ that has DST (so with a > > time difference that changes along the year). > > > > Is there an automatic/intelligent way to do that? > > Not that I know of, yet since timezones only change twice a year you > can look up the changes for the coming year and adjust the crontab > accordingly. Hey, I am too lazyto change my crontab twice a year, and we have computers, they should do the work for us. The way I did it: - start the cron job at the earliest of both time (winter time, or summer time). - at the begining of the job, have a small Perl script that will wait until it is the specified time in the specified time zone: at best it will not wait, at worst the perl script will sit idled for one hour before giving the hand back to the real job. Et voila (well, it will be et voila once the job will have completed succesfully once :) Thanks, Olivier