[SOLVED] "at command" parses timespec incorrectly

This forum is for discussion about general software issues.

[SOLVED] "at command" parses timespec incorrectly

Postby h2o » Tue Apr 18, 2017 3:23 am

Hi, all
I'd like to execute a command at UTC time.
But "at command" execute a command at the time one hour before when I specified.

this form is correct.
$this->bbcode_second_pass_quote('', '$') printf ": do nothing\n" | TZ=GMT+0 at 0400
warning: commands will be executed using /bin/sh
job 49 at Tue Apr 18 04:00:00 2017


this form is incorrect. the job scheduled at one hour before. (03:00:00)
$this->bbcode_second_pass_quote('', '$') printf ": do nothing\n" | TZ=GMT+0 at 0400 UTC 04/18/2017
warning: commands will be executed using /bin/sh
job 50 at Tue Apr 18 03:00:00 2017


$ uname -a
Linux alarmpi 4.9.22-1-ARCH #1 SMP Fri Apr 14 19:47:11 MDT 2017 armv6l GNU/Linux
Thanks in advance!
Last edited by h2o on Tue Apr 18, 2017 1:42 pm, edited 1 time in total.
h2o
 
Posts: 3
Joined: Tue Apr 18, 2017 2:11 am

Re: "at command" parses timespec incorrectly

Postby WarheadsSE » Tue Apr 18, 2017 12:00 pm

https://linux.die.net/man/1/at

From all I can tell, your use of 'UTC' in the string is screwing it up.


https://www.archlinux.org/packages/community/x86_64/at/

If this is somehow a bug, this isn't something to report to us, unless you can somehow trace it down specifically to Arch Linux ARM
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: "at command" parses timespec incorrectly

Postby h2o » Tue Apr 18, 2017 1:38 pm

I found this article.
https://bugs.debian.org/cgi-bin/bugrepo ... bug=364975

This strange behavior seems to be related to daylight saving time.
I found out the cause, so I will consider how to avoid it.
h2o
 
Posts: 3
Joined: Tue Apr 18, 2017 2:11 am

Re: [SOLVED] "at command" parses timespec incorrectly

Postby WarheadsSE » Tue Apr 18, 2017 4:20 pm

If you're planning on have the running be at UTC, why not just use TZ=UTC0 in place of TZ=GMT+0 ?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: [SOLVED] "at command" parses timespec incorrectly

Postby h2o » Wed Apr 19, 2017 1:17 am

Even if "UTC 0" is set, the behavior does not change.
The "at command" with the time specified in UTC seems to work correctly only during officially set daylight saving time.
"officially set daylight saving time" means the tm_isdst is set.
I live in areas which do not use daylight saving time, so the command is always scheduled an hour before.
I will specify an hour later to "At command".
h2o
 
Posts: 3
Joined: Tue Apr 18, 2017 2:11 am


Return to General

Who is online

Users browsing this forum: No registered users and 5 guests