From owner-freebsd-questions@FreeBSD.ORG Sun May 24 05:41:37 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 2E1881065673 for ; Sun, 24 May 2009 05:41:37 +0000 (UTC) (envelope-from tajudd@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by mx1.freebsd.org (Postfix) with ESMTP id D92CE8FC1A for ; Sun, 24 May 2009 05:41:36 +0000 (UTC) (envelope-from tajudd@gmail.com) Received: by qw-out-2122.google.com with SMTP id 3so1430144qwe.7 for ; Sat, 23 May 2009 22:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=SFndRg3/tEXqQxuI9lCTmKy1sf16jhAkbqBtaHYIPJ4=; b=M7ZpTBOUPjU1/0hnQSXB/PKRJiVb4rI0hXnS8Lrn8jrqHtY0lNqGVXvnh20w4hTV1V V+xbwpqz03kAWgLXBoQXEB1fE0jxDC9hjmAuiM7F2dafghJuQP16RrqHGPVqZuDjmsnI M8cKZJ9+GSb12tubEqoXf0Y9MIJP//ZiHv4Gs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=qtALxbZF8fQLytPsaA/++MiaVSTVdaxzq7lz37XQeUW0m7io5svz9oSIWEuQBP5AV8 wnQEcg0rPLef+9AG+ha82U7UZWqqYY1FdZIj3CeEU2FlteFUTNdPLfSEQecfd6z4MA7J 3VofrM8f2TFDCi+hAm6TE3xZ/0cYPe92bSn78= MIME-Version: 1.0 Received: by 10.220.97.210 with SMTP id m18mr4921556vcn.50.1243143696267; Sat, 23 May 2009 22:41:36 -0700 (PDT) In-Reply-To: <1243136795.29198.42.camel@ubuntu> References: <1243136795.29198.42.camel@ubuntu> From: Tim Judd Date: Sat, 23 May 2009 23:41:16 -0600 Message-ID: To: Sarah.Varney@marketmentat.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Sun, 24 May 2009 05:41:37 -0000 On Sat, May 23, 2009 at 9:46 PM, GT wrote: > Late entry to this thread, but... > > I thought I had found an answer to this; at present I think I might have > been mistaken. > > My crontab has about a dozen jobs that need to run in > TZ=America/New_York, and another dozen that ideally want > TZ=Australia/Sydney... the server default is America/Chicago. > > Given that the DST wobble for Australia/Sydney is not the same as for > America/New_York (and given that I am lazy) I wanted ONE crontab that > would serve year-round, rather than FOUR crontabs that had to be swapped > in and out all the time (even if that could be done by a cron job). > > I thought I had found a solution - simply insert a line > > TZ=America/New_York > > before the US jobs, and > > TZ=Australia/Sydney > > before the Australian ones. A final statement to return TZ to sever > default would be optional. > > > I checked that TZ changes worked, by adding a cron job (for testing > purposes) under each TZ declaration, of the form > > TZ=America/New_York > * * * * * date >> /home/mysite/public_html/tmp/log.txt 2>&1 > > and > > TZ=Australia/Sydney > * * * * * date >> /home/mysite/public_html/tmp/log.txt 2>&1 > I propose the following: cron itself has no concept of timezone. it is 'date' that is picking up TZ and reporting as such. Cron's job is so simple is that it wakes up each minute to see if it has work to do, regardless of timezone, or anything else. You might want to try some other determining factor, such as a shell builtin. Good luck.