This is a short document detailing a method for anonymous Rsync operations from a NetWare source to a SLES destination.
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.
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.