Tuesday, March 25, 2008

Excluding directories from rsync backup

The thing is, some a**hole clients of hours don't mind keeping a lot of useless data on their servers. Basically I don't mind either, but this one time I had to discover, that because of this, the backup server ran out of space on one of its HDDs.

So I set to investigate the options, and the useful thing I discovered was how to exclude directories in rsyncd.conf.

Here's an example.

[hosts]
path = /home/hosts
comment = serv1
hosts allow = x.x.x.x
exclude = www.domain1.com/ www.domain2.com/


This will exclude directories named domain1.com and domain2.com. More on the syntax of the exclude command can be found at

http://www.ss64.com/bash/rsync.html

No comments: