You are not logged in.

#1 2009-11-12 20:45:56

alexs77
Member
From: North of Italy, East of France
Registered: 2009-10-31
Posts: 3

"at" ignores timezone?

Hi!

Could somebody please try to explain this?

$ echo ls | at 20:08 UTC Nov 12
at: refusing to create job destined in the past

$ date
Do 12. Nov 21:00:53 CET 2009

$ date --utc
Do 12. Nov 20:00:57 UTC 2009

$ grep ^HARDWARECLOCK\\\|^TIMEZONE /etc/rc.conf
HARDWARECLOCK="UTC"
TIMEZONE="Europe/Zurich"

As you can see, it was 19:51 UTC (or 20:51 CET) when I ran that. I wanted "at" to execute "ls" at 19:55 UTC November, 12. But at refused to do this, stating that the time is in the past? Why's that? At that time, it was about 4 minutes in the future.

BUT see this:

$ echo ls | at 21:08 Nov 12
warning: commands will be executed using /bin/sh
job 16 at Thu Nov 12 21:08:00 2009

$ echo ls | at 21:08 UTC Nov 12
warning: commands will be executed using /bin/sh
job 17 at Thu Nov 12 21:08:00 2009

That "job 16" had been created was to be expected (well, at least I expected it...). But have a look at when job 16 and job 17 are supposed to run - at the same time? No, that's WRONG! job 17 should be run 1 hour later, because 21:08 UTC == 22:08 CET!

If I do the same on a Solaris 10 system, I get the expected result:

--($ ~)-- date                                                                                                                                     
Thu Nov 12 21:09:51 CET 2009

--($ ~)-- date --utc                                                                                                                               
Thu Nov 12 20:09:52 UTC 2009

--($ ~)-- echo ls | at 20:20 UTC Nov 12                                                                                                            
commands will be executed using /opt/csw/bin/bash
job 1258057201.a at Thu Nov 12 21:20:00 2009

--($ ~)-- echo ls | at 20:20 Nov 12                                                                                                                
at: too late
You have new mail in /var/mail//askwar

--($ ~)-- date                                                                                                                                     
Thu Nov 12 21:10:32 CET 2009

--($ ~)-- echo ls | at 21:20 Nov 12                                                                                                                
commands will be executed using /opt/csw/bin/bash
job 1258057202.a at Thu Nov 12 21:20:00 2009

This also works on Mac OS X.

On a Debian and also a Mandriva system that I have somewhere, I get the same results as on ArchLinux.

Could somebody please confirm this?

Seems as if this is a fundamental bug in at, doesn't it?

Offline

Board footer

Powered by FluxBB