Op 07-12-18 om 15:43 schreef Adrian:
> I've got a cron job that runs every minute, calling a bash script. The
> script writes out to a log file every time it runs giving the state of a
> sensor, typically four or five lines of output, and each stage starts
> with the time, generated by :
>
> date +%H%M
>
> If there is a change in the state of the sensor, then this will be
> reported, using just the date command :
>
> echo `date`
>
> The strange thing is that the entries published every minute are
> accurate, but in the change of state entries can be out by anything up
> to 9 minutes late, the discrepancy varies.
Is it possible that two different date programs are called? Maybe one is
the program and the other a script or an alias? (although aliases don't
work from a script). Are both run from a sudo context? One might be in a
different $PATH. Try being very specific:
/bin/date '+%T'
echo "$(/bin/date '+%F %T %z') message"
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|