Take2: rsync over ssh with --link-dest

Alex mysqlstudent at gmail.com
Tue Nov 10 20:47:10 MST 2009


>> Simplicity. I'd like to be able to have the server side feed me all
>> data beginning with the path I specify, such /backup/serverA,
> In other words, you were specifying a bogus source path and counting on
> sshd to override it with the real one.  Clever.  I didn't catch that the
> first time.

Yes, not sure if I mentioned previously, but I had:

command="/usr/bin/rsync ... -server ... /path"

followed by the actual ssh key.

> Realize that the ability to set a module's "path" in the rsyncd.conf
> file and have the client refer to the module by a well-known name gives
> you the same functionality, and actually more, because the client can
> specify a subdirectory path within the module.

I'm not sure I understand fully, but this may be what I'm already
doing. An example would be helpful.

>> and have
>> the client side be able to "--include=/usr/bin" to be able to
>> 'download' only the data from /backup/serverA/usr/bin and exclude
>> everything else.
> That --include means "exclude everything else" is a common
> misconception; see the man page.  But I imagine the issue will become

Yes, understood; it is what I would _like_ to happen.

> If the daemon solution is looking fundamentally more complicated than
> the set of forced server commands you previously had, you're probably
> going about it the wrong way and I could help if you post the
> rsyncd.conf file.

Okay, great, it's included below.

To make it even more complicated, on the receiving (client) side, I
have to pass the backup script I use through sed to rewrite the date
which gets appended to the source path, to update every day so I can
use the --link-dest rsync argument to create a backup of only the
changes from day-to-day, and hard link the rest from the reference
location, which is usually the previous day.

use chroot = no
syslog facility = local5

   list = true
   path = /backup/servers/xxx.xxx.228/cdrive
   comment = 228-cdrive
   read only = true
   gid = root
   uid = root

   list = true
   path = /backup/servers/xxx.xxx.228/ddrive
   comment = 228-ddrive
   read only = true
   gid = root
   uid = root

   list = true
   path = /backup/servers/xxx.xxx.228/edrive
   comment = 228-edrive
   read only = true
   gid = root
   uid = root

   list = true
   path = /backup/servers/xxx.xxx.229/
   comment = server229
   read only = true
   gid = root
   uid = root

   list = true
   path = /backup/servers/xxx.xxx.249/
   comment = server249
   read only = true
   gid = root
   uid = root

The client side command looks something like this:

rsync -avz --delete --numeric-ids --exclude-from=/backup/exclude-file.txt \
     --link-dest=/backup/seg/serverA/xxx.xxx.228/cdrive/20091109 \
     rsync://serverA/cdrive/20091110/ \


More information about the rsync mailing list