Configuring the time on a Centos box –
First we make sure we have a backup of the current timezone configuration, then we set it to the required timezone.
mv /etc/localtime /etc/localtime.bakln -s
Then we install the ntp daemon if not already installed. We then switch it on, get the current time and start the daemon.
yum install ntp ntpdate ntp-doc
chkconfig ntpd on
service ntpd start
rsync is great to keep two folders or machines in sync, either locally or remotely. However, there are loads of command line options that can look complex for the initial user.
I have used the following command to sync one folder to another –
rsync [options] [source] [destination]
rsync -anvP /mnt/hda/pictures/2007/ /mnt/windows/pictures/2007
Notice that when you specify the source you must have a trailing ‘/’ to indicate the source directory. The destination is then specified by the directory you want to sync the files into.
By default rsync will not delete any files in the destination that it does not find in the source.
In the example above –
a – archive, this will sync folders recursively and deals with symbolic links and other special files. It also preserves dates, times, owners etc.
n – dry run – just show on the screen what will be done. Nothing is actually moved, created/deleted.
v – verbose, additional output onscreen.
P – Progress & Partial, shows progress of transfers and also allows restart after partial sync.
You may have noticed in the above example that both folders are in /mnt/…… I am using a Centos server to sync some folders from a HDA NAS system back to a Windows Home Server. Both systems are presenting shared drives that the Centos server has mounted and is then scanning in order to complete the rsync. The windows files shares are mounted using mount.
mount -t cifs -o user=centos //188.8.131.52/pictures /mnt/hda/pictures/
mount -t cifs -o user=windows //184.108.40.206/pictures /mnt/windows/pictures/
When entering the above commands you will be prompted for the password of the user supplied in order to access the fileshare.