Rsync Server

Another new and different method to create your backups, a client with important data connecting to a rsync server. I describe a simple method without authentication (trusted LAN), there are no configuration limits.

First thing is to install rsync:

1
aptitude update && aptitude install rsync

Create a public directory for your backups and make it writable:

1
2
mkdir /var/backups/my_network
chmod 777 /var/backups/my_network

Enable rsync daemon (by default disabled!):

1
2
3
4
vim /etc/default/rsync
RSYNC_ENABLE=false
# to
RSYNC_ENABLE=true

Thats not all, you still need to modify inetd’s config yourself:

1
2
3
vim /etc/inetd.conf
# add this single line to inetd.conf
rsync   stream  tcp     nowait  root   /usr/bin/rsync rsyncd --daemon

from: man rsyncd.conf
Rsync will run on port rsync 873/tcp, this is defined in: /etc/services

1
2
3
4
5
6
7
8
9
10
11
12
13
14
vim /etc/rsyncd.conf
# content of rsyncd.conf
[backups]
comment = For backups
path = /var/backups/my_network
use chroot = true
uid = backup
gid = backup
log file = /var/log/rsyncd/backups.log
read only = false
write only = false
hosts allow = 192.168.3.0/24
hosts deny = *
transfer logging = false

And finely rsync can bes started:

1
/etc/init.d/rsync start

Check the rsync status(or ps fax):

1
2
root@server:~# service rsync status
rsync is running.

If your rsync daemon was successfully started, you can make a local test connection:

1
2
3
root@server:~# rsync rsync://localhost
# you will get a answer
backups         For backups

Use rsync with proxy

1
export RSYNC_PROXY=192.168.3.36:8080

Try to sync a file:

1
rsync deli-0.8.0-core.iso rsync://192.168.3.213/backups/

The connection was denied by proxy, from squid access log:

1
CONNECT 192.168.3.213:873 HTTP/1.0 403 3391 TCP_DENIED:NONE

Allow rsync port in your squid.conf:

1
2
acl Safe_ports port 873
acl SSL_ports port 873

After fixing squid.conf we get a positive result:

1
CONNECT 192.168.3.213:873 HTTP/1.0 200 55803 TCP_MISS:DIRECT

0 Responses to “Rsync Server”


  • No Comments

Leave a Reply