Re: Which timezone does the cron use in Debian?



On Sun, 22 Mar 2009 17:15:09 -0500
"Boyd Stephen Smith Jr." <bss@xxxxxxxxxxxxxxxxx> wrote:

In <20090322151837.7d584022.celejar@xxxxxxxxx>, Celejar wrote:
On Sun, 22 Mar 2009 13:18:34 +0000
Nuno Magalhães <nunomagalhaes@xxxxxxxxx> wrote:
and the date and time is correct. They're the same as the bios (cmos)
clock shows.
I'd assume cron uses system-time, so whichever time 'date' tells
you... Did you check to see you don't have any other cron-jobs alying
around?
But IIUC, timezone is a property of individual user environments, and
is not a systemwide constant;

It can be overridden by an individual user's settings, but it is also
configured system-wide via the /etc/localtime file/symlink.

Thanks; I didn't realize this.

...

I assume, but I'm no expert, that cron also uses the
timezone of the user whose cronjob it's currently running.

I don't think the user's .bash_profile, .profile, etc. are sourced during a
cron run. Your .bashrc might, but normally not. Even global files of this
type like /etc/profile are generally not sourced during the cron run.

This means that the user's overrides are generally not honored, so the
timezone will be what is specified in /etc/localtime. The overrides are all
via environment variables, so you can set them in your crontab if you want.

Thanks for the explanations.

Celejar
--
mailmin.sourceforge.net - remote access via secure (OpenPGP) email
ssuds.sourceforge.net - A Simple Sudoku Solver and Generator


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: "superblock last write time is in the future" on boot
    ... > some timezone. ... I'm also running testing. ... for instance but the log entries are in UTC. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Which timezone does the cron use in Debian?
    ... It can be overridden by an individual user's settings, ... timezone of the user whose cronjob it's currently running. ... type like /etc/profile are generally not sourced during the cron run. ... This means that the user's overrides are generally not honored, ...
    (Debian-User)
  • Re: Scripted method to change TZ from UTC to a specific timezone?
    ... for automatically via script. ... A reboot is ok if absolutely needed but ... In the case of changing the system default timezone this is probably ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • question about timezone
    ... I actually run a debian etch on my computer. ... I live in France ... and the timezone is gmt/utc +01:00. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: XFCE4 DateTime applet - custom timezone
    ... timezone - UTC for now. ... timezone and configure it to display the time zone of choice, ... It looks like every time zone known to the system is ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)