SUSE Conversations


RSYNC: NetWare to SLES



By: sideshow

June 20, 2008 5:13 pm

Reads:300

Comments:0

Rating:0

This is a short document detailing a method for anonymous Rsync operations from a NetWare source to a SLES destination.

The following has not been tested by myself outside of a lab environment; do not take this as a definitive backup solution without sufficient restore tests.

There are many methods for using Rsync to replicate your data, this document concentrates on setting up an Rsync daemon process on the SLES server that will constantly listen for incoming Rsync requests. A degree of security is established through the use of the host allow option, as the daemon will only allow requests from the NetWare server it removes any real requirement for user authentication.

Additional information:

man rsync
man rsyncd.conf

http://samba.anu.edu.au/rsync

Step 1: Configure the Daemon

Rsync will be available on a standard SLES 10sp1 (with or without OES components) build. We need to enable it to be running on startup.

Launch YAST –> System –> System Services (runlevel)

Change to Expert Mode then select the rsyncd service. Select the checkboxes for runlevel 3 and 5.

Under the Start / Stop / Refresh button select Start Now…

Click OK on the startup popup then select Finish.

Configuration options for the Rsync Daemon are available through the /etc/rsyncd.conf file.

The example below is configured for anonymous connections:

motd = /etc/motd 	
uid = nobody 	
gid = nobody 	
read only = false 	
use chroot = true 	
transfer logging = true 	
log format = %h %o %f %l %b 	
log file = /var/log/rsyncd.log 	
hosts allow = 192.168.1.20 	
exclude from=/etc/rsync.exclude
[VOL1] 	        
path = /backup/VOL1 	        
comment = An Example 
[USER]
path=/backup/USERS
comment = An Example

The following Global options will need to be modified and will be unique to your environment:

motd – Message of the Day file (optional, rem if not wanted)
hosts allow – IP address / hostname of connecting NetWare server/s (specify multiple as x.x.x.x, x.x.x.x, x.x.x.x)
exclude from – text file with line by line exclusions (e.g. – *.mp3, *.avi, *.mpg)

The following Module options will need to be modified:

The module name ([VOL1], [SHARED], etc) modify these to reflect volume names
path – Destination of the NetWare source data
comment – Optional comment for your reference

After modifying the rsync.conf file there is no need to restart the rsyncd server, the config file is read each time an Rsync connection is established.

Make sure the paths specified under the volume modules in rsyncd.conf exist and chmod them at 777 (rwx for all). I am unsure what are the minimum rights required for the NetWare server to copy files to this path, I tried a few combinations but nothing worked, documentation seems to be lacking.

Step 2: Source configuration

Now we need to setup the NetWare server. Obtain the latest rsync.nlm from http://forge.novell.com and copy it to sys:\system\rsync (you will need to create this path).

Edit your Autoexec.ncf and under the existing search paths include:

SEARCH ADD SYS:\SYSTEM\RSYNC

Run this search command from the system console now also.

The following is an example Rsync command that will allow you to connect to the SLES box previously configured:

rsync -av --log-file=sys:\system\rsync\rsync.log --volume=vol1: ./ 192.168.1.20::VOL1

This will run archive mode with increased verbosity (-av) with logging to sys:\system\rsync\rsync.log (–log-file=sys:\system\rsync\rsync.log) on vol1 (–volume=vol1:) all sub directories (./) to the destination SLES IP address under the VOL1 module path (192.168.1.20::VOL1).

As you will not want to be typing these long commands on the console regularly and trustees are not backed up with Rsync, we will create an rsync.ncf file to automate the two.

Step 3: Automate the process

Use edit on your NetWare server and create a sys:\system\rsync\rsync.ncf file based on the following setup (change volume names / IP addresses where appropriate).

trustee /eti save vol1: vol1:\trvol1.txt
rsync -av --log-file=sys:\system\rsync\rsync.log --volume=vol1: ./ 192.168.1.20::VOL1
trustee /eti save users: users:\trusers.txt
rsync -av --log-file=sys:\system\rsync\rsync.log --volume=users: ./ 192.168.1.20::USERS

Continue with as many volumes as you want to backup making sure to precede each volumes Rsync command with the relevant trustee backup. It may also be a good idea to grab a copy of your DIB while you are here with an entry like: load dsrepair -RC VOL1:\DIB (this would go before VOL1 Rsync command).

Once you are happy with your rsync.ncf file you should give it a test run to make sure it’s all working and happy (best after hours if you’re in production).

Now we need to get this going with cron.

Use your NetWare edit command to open sys:\etc\crontab and add an entry for your rsync.ncf file, the following is an example NetWare Cron file that will run Mon-Fri at 10:30pm:

30 22 * * 1-5 rsync.ncf

Crontab files are in the format: Min Hour Date Month Day. You can find plenty on online documentation on crontab syntax, there are a myriad of options that are beyond the scope of this document.

Edit your Autoexec.ncf and add a line with the CRON command.

Run CRON from the system console now also.

Step 4: Restore

To bring the data back from the SLES server simple change the rsync command switch order from the Netware server:

rsync --av --log-file=sys:\system\rsync\rsync.log 192.168.1.20::VOL1 ./ --volume=vol1:

This will restore from the SLES server VOL1 module.

Now restore the trustees:

Trustee /restore vol1:\trvol1.txt

This should be the correct path after restore.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: , ,
Categories: SUSE Linux Enterprise Server, Technical Solutions

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.

Comment

RSS