[nSLUG] Time zone calculation
linux at zdoit.airpost.net
Wed Mar 7 16:23:15 AST 2007
Bill Davidson wrote:
> On my system there is a script "/usr/sbin/atrun" which used to be
> invoked by cron every minute, and which runs "atd -s", which processes
> the "at" queue once and exits. You could set up similar scripts, each
> of which invokes "atd" with a different TZ variable, and, umm, somehow
> knows which scripts to run and which not to run. I guess you could
> modify the "atd" source to have different queue directories, so then you
> could have in /usr/sbin/atrun:
> TZ=Australia/Melbourne /usr/local/sbin/atd-melbourne -s
> TZ=Africa/Khartoum /usr/local/sbin/atd-khartoum -s
> Not very elegant, I know. If there was a way to invoke atd with a queue
> name that would be better. Heck, as long as you're modifying atd...
> I hope you can get a useful idea from this.
I was able to figure it out, though it took me 4 hours to convince
myself it worked.
If I export TZ=/usr/share/zoneinfo/Australia/Sydney and then issue the
at command it uses local time in Australia. I got confused when I
thought that atq was reporting without adjusting for timezone.
More information about the nSLUG