Published January 15th, 2004 by Jim O'Halloran

Rsync backups of NT machines

I got into a converstation today at Linux.Conf.Au about backups, and along the way I happened to mention that I use RSync on oune of our Linux boxes to back up our NT servers and Windows workstations to a remote linux box via ssh. I thought I’d share part of my script with everyone so you can see how I did it…

#!/bin/bash

# Unmount any existing samba share.
umount /mnt/samba

# Mount and rsync the devel share.
printf "\n\nRsync'ing devel share...\n\n"
mount -t smbfs -o username=/,password=
 /// /mnt/samba
rsync -avz -e ssh –delete –exclude-from=/root/excludes.txt “/mnt/samba/” backup@fairy:/mnt/backup/devel
umount /mnt/samba

This script runs on the NAT gateway between out internal network and the internet. “fairy” is the backup server at home, and I’ve setup a paswordless key so I can ssh into it from the NAT box automatically. The z switch on rsync compresses the data, and ssh handles encryption. /root/excludes.txt looks like this…

*.mdf
*.ldf
*.dat
*.zip
*.tmp
*.ran
*.bkp

… and is used to stop certain file types from being backed up.

I’ve also heard of people using hard links and rsync to store multiple backup sets on the same disk without wasting space. I can’t find a reference to the exact document I’ve seen before, but this describes something similar.


0 Responses to “Rsync backups of NT machines”

Feed for this Entry
  1. No Comments

Leave a Reply

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>