RHEL5 : the GNU/Linux `at` command behaves incorrectly with a given date in the past
Issue
In RHEL5, if the date provided to at is already past, the requested command is being executed immediately. Also, if the date does not contain a year, it will default to the current year, even when the date is past already.
Examples :
# echo date | at 10:30 8 Jan
job 10 at 2012-01-08 10:30
# mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/root": 1 message 1 new
>N 1 root@dhcp-27-77.brq. Mon Aug 27 13:26 16/734 "Output from your job 10"
& d
& q
# echo date | at 10:30 8 Jan 2010
job 11 at 2010-01-08 10:30
# mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/root": 1 message 1 new
>N 1 root@dhcp-27-77.brq. Mon Aug 27 13:28 16/734 "Output from your job 11"
The above examples show that the command does not behave as expected :
- The chosen year is automatically set to 2012 even if date is past already
- If the date is past, the command is executed immediately instead of aborted
Newer versions, such as the one shipped in RHEL6, behave as expected :
- The year defaults to next one if the date is past already (but no year provided)
- If the date is past, the requested command will not be executed
Environment
- Red Hat Enterprise Linux (RHEL) v.5
- at-3.1.8
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
