V

date is not date

It's like every morning a groundhog is greeting from out of your scripts. There is one (a bash script, not a groundhog) which monitors some processes and notifies users when triggered. It runs every hour but it should send notifications only every 6 hours. And, of course, it does so on a bunch of servers. Last night, it was triggered (for the first time) on another server. But the notifications were sent every 2 (!) hours.

There is the script groundhog winking at me :-/ So what happened?

date is not date

The script was last run at 2007-10-30 07:46:01. It will run again at 08:46. It should not notify users before 13:46. But it will do (unless I rewrite it) at 09:46. Here is why:

# Server 1 (Debian Sarge)
$ date -d "2007-10-30 07:46:01 + 6 hours"
Tue Oct 30 13:46:01 CET 2007
$ date --version
date (coreutils) 5.2.1
Written by David MacKenzie.
(...)
# Server 2 (Debian Testing)
$ date -d "2007-10-30 07:46:01 + 6 hours"
Tue Oct 30 09:40:00 CET 2007
$ date --version
date (GNU coreutils) 5.97
(...)
Written by David MacKenzie.

Discussion

Andreas Schamanek, 2007-11-02 10:16

I was looking for related bugs in the Debian Bug Tracking System but could not find any which describe precisely what I found. Just one bug seems to be loosely related: #285609 coreutils: date -d 'next tuesday' shows today's date on Tuesdays

Enter your comment. Wiki syntax is allowed:
A F A K A
 
 
blog/071030_date_is_not_date.txt · Last modified: 2007-10-30 08:39 by andreas