Skip to main content
How to setup an RSYNC Server on a CommGate Professional Server 3.x

1) Install the rsync daemon via apt-get by typing the following command on a CommGate system as user root;

apt-get update
apt-get install rsync


2) Create the rsync daemon configuration file so that we can start the xinetd service and the rsync daemon is automatically started. Edit the following files;

vi /etc/rc.d/xinetd.d/rsync



Add the following lines in the configuration file;


# default: off

# description: The rsync server is a good addition to
# an ftp server, as it
allows crc checksumming etc.

service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync

server_args = --daemon

log_on_failure += USERID

}


3)
Configure the /etc/rsyncd.conf file as follow;

## This is the rsyncd configuration file to start the rsync
## daemon for
remote synchronization of data.

log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
max connections = 5
syslog facility = local3

[name-of-shared-path]
path = /opt/named/of/shared/path
comment = Change to the Name of Shared Path
auth users = root
secrets file = /etc/rsyncd.secrets
uid = root
gid = root
read only = yes
list = yes
hosts allow = 127.0.0.0/8 192.168.1.0/24


4) Export the RSYNC password as follow;

export RSYNC_PASSWORD=password



5) Set-up the RSYNC password file in case it will be needed for rsync scripts as follow;


vi /etc/rsyncd.secrets



Within the file, type the rsync username and password in the following format;


root:password

user1:password

user2:password



Save the file with command;


:wq



Change the file ownership as follow;

chmod 600 /etc/rsyncd.secrets


5) Start the RSYNC server as follow;

service xinetd start


6) Test the RSYNC server setup from the server;

rsync localhost::


You should see these;

rsync localhost::
name-of-shared-path Change to the Name of Shared Path


7) Viola! Your rsync server is ready and you can now use your Linux PC/Server rsync client to do rsync backups!

8) Here's how you can create the script to run the backup automatically via
cron.

9) Decide on where you want to store all your administration scripts. Mine is in /root/scripts/ so I create multiple rsync scripts for every individual server.


Example of my rsync script.

#!/bin/sh
export RSYNC_PASSWORD='mypassword'
/usr/bin/rsync -av --stats --progress --exclude "*.tmp" --exclude "*.c" \
root@192.168.1.100::HOME /home > /var/log/rsync.log


10) I then edit my crontab to backup my data to my rsync server which has 500GB (RAID-5) storage every hourly via rsync. The command to edit your crontab is as follow;

crontab -e


11) I add the following line in my crontab.

0 0-23 * * * /root/scripts/rsync-backup-home.sh


That's all folks! You now have an RSYNC server and you can start backing-up all your Windows and Linux PC/Servers automatically without forgetting it ever again or worrying about loss of data anymore. Of course you should think of offline storage too if your data is worth a lot of money. That's where a tape-drive is useful :)

Comments

Popular posts from this blog

Keep your mail servers off blacklisting sites

Keep your mail servers off blacklisting sites and avoid being flagged as spam! by Moonshi Mohsenruddin, CEO CommGate, Inc. Greetings! This blog will be shared by my fellow team mates - Mr. Tan Hock Chye, Technical Manager, Mr. Ramesh Raman, Chief Technology Officer and Mr. Abhik Biswas, Chief Marketing Officer of CommGate. We will be posting alternately, in attempt to bring mind blowing technology thoughts to you on a regular basis. If you would like to read more about who we are and what we do, please do check out our profile on our corporate website. These days, it seems like every other email servers/hosts are tightening the screws on their email servers just a little bit more in order to battle against spam and viruses. Generally speaking, having more servers out there tightening their security and policies is a good thing. However, if you do not follow some basic precautions on your own email server(s), valid email from your hosted email domains may start to be flagged as spam...

From Toilet Cleaner to CEO

On 22-April-2012, my entrepreneurship journey story was published by The Sunday Times in Singapore by Mr. Wong Kim Hoh

The 4 Essentials of Effective Leadership

I read this article written Mark Raciappa, ActionCOACH and I totally agree. His communication is clear, concise and it resonated with me. Mark says; I remember a bumper sticker: “Either Lead or Follow—But Get Out of the Way!” Interestingly, in my company , I say something similar and it goes like this "If you can lead, lead. If you can't lead, follow. If you cannot lead or follow, get out of my way! Mark continued to write that, when our role calls for the former, here are 4 important things to keep in mind: 1. Great leaders communicate. Realizing that good communication is a 2-way street, we must be responsible for our part. That being said, true communication is the response that you get. Whatever form you choose (verbal, mail, e-mail, etc), if you don’t get the outcome you seek (from a “willing” recipient), the responsibility lies with the sender. Great leaders confirm, gain commitment, and solicit feedback to improve the process. 2. Great leaders make decisions...