This is an old revision of the document!


DNS323 RSync Time Machine for Windows

An interesting article titled “DNS323 RSync Time Machine!” was posted here on the DNS323 forum. The author, raid123, brought to light some very interesting information regarding use of RSync's hard links. Following implementation of such on my NAS I couldn't help but wonder if a similar approach could be used to backup data from three Windows based PC's located throughout the household. Following a brief search of the Internet I was pleased to see tools capable of assisting in this regard were available.

Assumptions

Before getting started lets declare a few assumptions;

  1. The DNS323 contains two separately configured disk drives; Volume_1 and Volume_2
  2. Volume_1 of the DNS323 contains user data
  3. Volume_2 of the DNS323 contains backup data
  4. Your capable of adding folders to the DNS323 and setting user access rights
  5. ffp version 0.5 is installed, configured and running without error. Check the fun_plug.log to be sure!
  6. You have telnet or SSH access to the /ffp/* folders on your DNS323
  7. You know how to use
    • and have an editor capable of creating text files on your DNS323 (I use notepad++)
    • the CHMOD command to change files rights
    • and create DOS batch files
    • and add a task to the Windows Task Scheduler


Basics Steps

Establishing a DNS323 RSync Time Machine for Windows requires;

  1. The addition of appropriate folders and establishment of user access rights on Volume_2 of the DNS323.
  2. The addition of Cygwin RSync for Windows (Gaztronics.net) on each Windows PC that you wish to backup
  3. Creation of an rsyncd.conf configuration file in the /ffp/etc/ folder of the DNS323
  4. Creation of an rsyncd.secrets file in the /ffp/etc/ folder of the DNS323
  5. Creation of a secret file in the C:\Cygwin\etc folder of each Windows PC
  6. Setting the execution bit of the /ffp/start/rsyncd.sh file active
  7. Starting the /ffp/start/rsyncd.sh
  8. Creation of a batch file for each Windows PC
  9. The addition of a task to the Windows Task Scheduler
  10. A sip of your favourite beverage to celebrate your success!


Detailed Steps

Add Storage Folders to Your DNS323

Volume_2 of my DNS323 contains backup data thus three folders were created on this volume to house data copied from each of the three Windows PC. For this example the folders will be named Backup_PC1, Backup_PC2 and Backup_PC3. The folders were created using D-Link's GUI interface. Each folder was assigned access as follows;

Folder Name User Assignment Group Rights
Backup_PC1 User1 users R/W
Backup_PC2 User1, User2 users R/W
Backup_PC3 User1 users R/W

Information in the table demonstrates User1 has access to all three folders while User2 has access to only the folder named Backup_PC2.

Add Cygwin and RSync for Windows

Installation of a package known as Cygwin on all three Windows PC's is necessary. Cygwin provides an RSync client and allows creation of a symbolic link at the end of the backup process. As with raid123's approach for the “DNS323 RSync Time Machine!”, a symbolic link named Current will take you to the latest backup directory.

Following instruction found at Gaztronics.net, install “RSync for Windows”. Although the instruction indicates three key Cygwin modules are required, I found that by installing the Cygwin utilities module (cygutils-1.3.2-1) symlinks could be built thus allowing creation of a link to the latest backup.

Create rsyncd.conf File

Using a text editor that supports Unix line endings create an rsyncd.conf file in the /ffp/etc folder of the DNS323. Save the following information within the file;

# /ffp/etc/rsyncd.conf configuration file
max connections = 2
secrets file = /ffp/etc/rsyncd.secrets
	
use chroot = false
read only = yes
list = false
strict modes = false
# Deny access to all hosts just to be on the safe side
hosts deny = * 
timeout = 600
dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz
pid file = /var/run/rsyncd.pid

[PC1Backup]
	comment = Primary Backup Location for PC1
	# Allow access to local hosts
	hosts allow = 192.168.1.0/24
	read only = false
	gid = users
	uid = User1
	auth users = User1
	path = /mnt/HD_b2/Backup_PC1

[PC2Backup]
	comment = Primary Backup Location for PC2
	# Allow access to local hosts
	hosts allow = 192.168.1.0/24
	read only = false
	gid = users
	uid = User1
	auth users = User1, User2
	path = /mnt/HD_b2/Backup_PC2

[PC3Backup]
	comment = Primary Backup location for PC3
	# Allow access to local hosts
	hosts allow = 192.168.1.0/24
	read only = false
	gid = users
	uid = User1
	auth users = User1
	path = /mnt/HD_b2/Backup_PC3

To ensure some level of confidentiality use CHMOD to set the properities of the file to rw-r–r– (CHMOD 644 /ffp/etc/rsyncd.conf)

Create rsyncd.secrets File on the DNS323

Using a text editor that supports Unix line endings create an rsyncd.secrets file in the /ffp/etc folder of the DNS323. Save the following information within the file;

# /ffp/etc/rsyncd.secrets configuration file
# File context;
# One line per user; a User ID separated by a colon then followed by a user password
# For example; UserName:UserPassword

User1:uh$Y49)f
User2:gYj$8gI4

To ensure some level of confidentiality use CHMOD to set the properities of the file to rw——- (CHMOD 600 /ffp/etc/rsyncd.secrets)

Create secret File on Each Windows PC

Using a text editor that supports Unix line endings create a file named secret in the C:\cygwin\etc folder of each of the three PC's. Only the users password is required within the file. For example the file for User1 would contain the following;

uh$Y49)f

The file for User2 would contain the following;

gYj$8gI4

Setup RSync to run as daemon

Work in progress…. More to come


Navigation

Personal Tools