Friday, February 20, 2009

How to sync or set date and time using ntpdate

First install ntp from yum

# yum install ntp

1. chkconfig ntpd on

This turns on ntpd for runlevel 2345

2. ntpdate us.pool.ntp.org
This initializes your clock to the US pool. Please use appropriate country pool, go to www.ntp.org as Mr C suggested.

3. service ntpd start
This starts the ntpd service

4. hwclock --systohc
This syncs the hardware clock to current time

The default settings in /etc/ntp.conf should work for most people. For more information, just man ntp.conf.

Sunday, February 8, 2009

How to backup and what to backup in hypervm + openvz node

Important things to backup is
/vz/private folder where all the vps data stored
/etc/sysconfig/vz-scripts folder where all the vps config file stored
/var/lib/mysql/hypervm1_0 where all the config of the hypervm stored

Simply make a bash file with the following commands and set in the cron job.

cp -ar /vz/private /backup/vz/
cp -ar /etc/sysconfig/vz-scripts/ /backup/vz/
cp -ar /var/lib/mysql/hypervm1_0 /backup/vz/

Happy backing up :))