Weblog entry #1 for debstar
#1
A backup server configuration for windows clients
Posted by debstar on Fri 10 Jun 2005 at 14:09
If you have a network of windows clients and want to build a backup server with GNU/Linux, this 2 cents tip is for you. You need rsync, samba version 3, quota and cwrsync for windows clients.
First, the principles.
(*) Windows clients backup their files via rsync onto the backup server.
(*) If a user want to restore a file, his/her home directory can be browsed inside the network neighborhood as read only.
(*) Configure properly quota so the backup server won't run out of disk space.
On the server side, you need to install samba, winbind, quota, quotatool & rsync.
Then you configure you /etc/samba/smb.conf according to your network settings which is for samba and winbind while with /etc/rsync.conf, you don't need to change it. In /etc/samba/smb.conf, the following lines are essentials :
On the client side, we need to install cwrsync in a directory e.g C:\CWRSYNC. This batch can be scheduled to run once a day :
Now, you can run this batch script to check evrything is okay.
First, the principles.
(*) Windows clients backup their files via rsync onto the backup server.
(*) If a user want to restore a file, his/her home directory can be browsed inside the network neighborhood as read only.
(*) Configure properly quota so the backup server won't run out of disk space.
On the server side, you need to install samba, winbind, quota, quotatool & rsync.
apt-get install samba winbind quota quotatool rsync
Then you configure you /etc/samba/smb.conf according to your network settings which is for samba and winbind while with /etc/rsync.conf, you don't need to change it. In /etc/samba/smb.conf, the following lines are essentials :
... [homes] comment = Home Directories browseable = no writable = no ...Seemlessly, these lines are available here and you just need to uncomment them. It's time to configure quota : You only need to edit /etc/fstab and, accordingly to your partitions (I put the homedir of the domain users under /home/DOMAIN and with its own partition) :
/dev/hda6 /home/DOMAIN ext3 defaults,usrquota 0 0This little bash script is helpfull when it's time to apply the quota rule for each domain user thanks to quotatool and wbinfo utilities :
#!/bin/sh
for i in `wbinfo -u`; do
quotatool -u $i -bq 200M -l '250 Mb' /home/DOMAIN/
# soft limit of 200 MBytes and hard limit of 250 MBytes
done
On the client side, we need to install cwrsync in a directory e.g C:\CWRSYNC. This batch can be scheduled to run once a day :
SET CWRSYNCHOME=C:\CWRSYNC SET CYGWIN=NONTSEC SET HOME=%HOMEDRIVE%%HOMEPATH% SET PATH=%PATH%;%CWRSYNCHOME% ; The interresting thing begin here rsync %USERNAME%@backup: ; To list the files on the server rsync -auvzP /dir_to_backup/ %USERNAME%@backup: ; Copies the files in the directory onto the server ; If you want to assign a drive in the command above
Now, you can run this batch script to check evrything is okay.