Difference between revisions of "Timezone"
m |
(VPS, VE -> container, some fixes) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | Time difference between Hardware Node and | + | Time difference between Hardware Node and container. |
− | During the distribution (redhat/centos) installer, you choose the timezone for your HN. The | + | During the distribution (redhat/centos) installer, you choose the timezone for your HN. The container template has its own preconfigured timezone. So, it is very possible for the zones to differ. |
− | + | To resolve the problem, you should configure your container to have the same timezone as the HN. For example, if EST is your preferred timezone: | |
− | To resolve the problem, | ||
<pre>rm -rf /etc/localtime 2>/dev/null; unlink /etc/localtime 2>/dev/null | <pre>rm -rf /etc/localtime 2>/dev/null; unlink /etc/localtime 2>/dev/null | ||
Line 12: | Line 11: | ||
vzctl exec 1041 ln -s /usr/share/zoneinfo/EST /etc/localtime</pre> | vzctl exec 1041 ln -s /usr/share/zoneinfo/EST /etc/localtime</pre> | ||
+ | --> Debian: | ||
− | + | o ' tzconf ' (as root) for interactive timezone change (it asks questions.) | |
− | |||
+ | You can find many more exciting timezones with: | ||
+ | find /usr/share/zoneinfo/ | more | ||
− | Or, here is a shell script that will let you change the timezones in ALL of your | + | Or, here is a shell script that will let you change the timezones in ALL of your containers: |
<pre>#! /bin/bash | <pre>#! /bin/bash | ||
for f in `ls /vz/private` | for f in `ls /vz/private` | ||
do | do | ||
− | vzctl exec $f rm - | + | vzctl exec $f rm -f /etc/localtime 2>/dev/null |
− | |||
vzctl exec $f ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime | vzctl exec $f ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime | ||
done</pre> | done</pre> | ||
[[Category:HOWTO]] | [[Category:HOWTO]] |
Latest revision as of 10:47, 11 March 2008
Time difference between Hardware Node and container.
During the distribution (redhat/centos) installer, you choose the timezone for your HN. The container template has its own preconfigured timezone. So, it is very possible for the zones to differ.
To resolve the problem, you should configure your container to have the same timezone as the HN. For example, if EST is your preferred timezone:
rm -rf /etc/localtime 2>/dev/null; unlink /etc/localtime 2>/dev/null ln -s /usr/share/zoneinfo/EST /etc/localtime vzctl exec 1041 rm -rf /etc/localtime 2>/dev/null vzctl exec 1041 unlink /etc/localtime 2>/dev/null vzctl exec 1041 ln -s /usr/share/zoneinfo/EST /etc/localtime
--> Debian:
o ' tzconf ' (as root) for interactive timezone change (it asks questions.)
You can find many more exciting timezones with:
find /usr/share/zoneinfo/ | more
Or, here is a shell script that will let you change the timezones in ALL of your containers:
#! /bin/bash for f in `ls /vz/private` do vzctl exec $f rm -f /etc/localtime 2>/dev/null vzctl exec $f ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime done