Tuesday, October 6th, 2009
All of our servers are currently based off of the Phoenix, Arizona, USA Timezone. This script allows this conversion from each HN (Host Node):
#!/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/America/Phoenix /etc/localtime done
Categories: OpenVZ
I believe a safer way of doing this would be
for i in `vzlist | awk ‘{print $1} | grep -v CTID’`
do
vzctl exec $i rm -f /etc/localtime 2>/dev/null
vzctl exec $i ln -s /usr/share/zoneinfo/America/Phoenix /etc/localtime
done
Because /vz/private may hold disabled/suspended/shutdown containers or even random directories.
I can only agree to VPSNoc. What about not running instances for example.
Anyway my suggestion is to use UTC all over the place as the reference clock setting.
As soon as you have multiple locations and/or need to work with people in different timezones it pays of.