Chris Schuld's Blog

personal musings on the composition of software

Written By: Chris Schuld 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

2 Responses to " Setting the Timezones across all VPS’s (OpenVZ) "

  1. vpsnoc says:

    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.

  2. serverhorror says:

    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.

Leave a Reply

About Chris

Chris Schuld

Thank you for visiting my website. I use this site for a myriad of things: maintaining software I have open sourced, connecting with my readers and friends and documenting all of this little things "I wished I would have written down." You can read more about me or contact me.


thanks for visiting... happy coding

Recent Comments