Difference between revisions of "SUNScholar/Disaster Recovery/Backups/Client Setup/Server Sync"

From Libopedia
Jump to navigation Jump to search
(Created page with "==Step 2. Setup daily sync to remote server== ===Create an rsync config file=== sudo nano /etc/rsyncd.conf Copy and paste the following. <pre> [backup] path = /var/backup [home...")
 
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Step 2. Setup daily sync to remote server==
+
<center>
 +
'''[[SUNScholar/Disaster Recovery/Backups/Client Setup|Back to Client Setup]]'''
 +
</center>
 +
 
 
===Create an rsync config file===
 
===Create an rsync config file===
 
  sudo nano /etc/rsyncd.conf
 
  sudo nano /etc/rsyncd.conf
 
Copy and paste the following.
 
Copy and paste the following.
 
<pre>
 
<pre>
[backup]
+
uid = root
path = /var/backup
+
gid = root
  
 
[home]
 
[home]
Line 21: Line 24:
  
 
===Start the rsync server===
 
===Start the rsync server===
  sudo /etc/init.d/rsync restart
+
  sudo service rsync restart
  
 
===Check the rysnc server===
 
===Check the rysnc server===
  sudo rsync localhost::backup
+
  sudo rsync localhost::home
 +
A listing of files should be displayed.
 +
 
 +
See example output below.
 +
<pre>
 +
dspace@repository:~$ sudo rsync localhost::home
 +
drwxr-xr-x        4096 2013/12/02 14:27:48 .
 +
drwxr-xr-x        4096 2013/12/05 12:29:27 backup
 +
drwxr-xr-x        4096 2013/12/05 12:29:27 dspace
 +
</pre>
  
sudo rsync localhost::home
+
===Add a firewall rule to allow the backup server to get to the backup files using the "rsync" service===
 +
''It is assumed that you have enabled a firewall on your IR server, if not please go to: http://wiki.lib.sun.ac.za/index.php/SUNScholar/Firewall and do so.''
  
===Add a firewall rule to allow the backup server to get to the backup files===
+
Then add the following firewall to allow the backup server to connect:
  sudo ufw allow from %hostname% to any port 873
+
  sudo ufw allow from %server-hostname% to any port 873
Replace %hostname% with the hostname of your backup server.
+
Replace '''%server-hostname%''' with the server hostname of your backup server.
 +
[[Category:System Administration]]

Latest revision as of 08:22, 22 July 2016

Back to Client Setup

Create an rsync config file

sudo nano /etc/rsyncd.conf

Copy and paste the following.

uid = root
gid = root

[home]
path = /home

NANO Editor Help
CTL+O = Save the file and then press Enter
CTL+X = Exit "nano"
CTL+K = Delete line
CTL+U = Undelete line
CTL+W = Search for %%string%%
CTL+\ = Search for %%string%% and replace with $$string$$
CTL+C = Show line numbers

More info = http://en.wikipedia.org/wiki/Nano_(text_editor)


Enable the rsync server

sudo nano /etc/default/rsync

Change false to true.

RSYNC_ENABLE=true

NANO Editor Help
CTL+O = Save the file and then press Enter
CTL+X = Exit "nano"
CTL+K = Delete line
CTL+U = Undelete line
CTL+W = Search for %%string%%
CTL+\ = Search for %%string%% and replace with $$string$$
CTL+C = Show line numbers

More info = http://en.wikipedia.org/wiki/Nano_(text_editor)


Start the rsync server

sudo service rsync restart

Check the rysnc server

sudo rsync localhost::home

A listing of files should be displayed.

See example output below.

dspace@repository:~$ sudo rsync localhost::home
drwxr-xr-x        4096 2013/12/02 14:27:48 .
drwxr-xr-x        4096 2013/12/05 12:29:27 backup
drwxr-xr-x        4096 2013/12/05 12:29:27 dspace

Add a firewall rule to allow the backup server to get to the backup files using the "rsync" service

It is assumed that you have enabled a firewall on your IR server, if not please go to: http://wiki.lib.sun.ac.za/index.php/SUNScholar/Firewall and do so.

Then add the following firewall to allow the backup server to connect:

sudo ufw allow from %server-hostname% to any port 873

Replace %server-hostname% with the server hostname of your backup server.