Error when filters exclude all files from transfer

Robert Crida rcrida at clue.co.za
Tue Mar 1 02:28:11 MST 2011


Hi

I am using rsync in combination with lsyncd to do incremental backups.

The following rsync command is being executed when lsyncd detects that files have changed:

/usr/bin/rsync -lptgoDsz --filter=.\ /etc/rsync.filter -r --delete --force --from0 --files-from=- / rsynchead::school

The file /etc/rsync.filter contains the following:

+ /home/*/.kde/share/apps/kmail/mail/**
+ /home/*/.kde/share/config/emailidentities
+ /home/*/.kde/share/config/kmailrc
+ /home/*/.kde/share/config/mailtransports
- /home/git/**
- /home/*/.*
- /home/*/.*/**
+ /etc/passwd
+ /etc/shadow
+ /etc/group
- /etc/**
+ /var/spool/mail/*

The list of files from lsyncd is piped to stdin.

On the rsynchead server I am seeing a lot of entries like:

Mar  1 11:23:12 rsynchead1 rsyncd[18773]: connect from fw.school158.gp-online.net (41.161.29.109)
Mar  1 11:23:13 rsynchead1 rsyncd[18773]: rsync to school158/ from fw.school158.gp-online.net (41.161.29.109)
Mar  1 11:23:14 rsynchead1 rsyncd[18773]: rsync: connection unexpectedly closed (24 bytes received so far) [Receiver]
Mar  1 11:23:14 rsynchead1 rsyncd[18773]: rsync error: error in rsync protocol data stream (code 12) at io.c(601) [Receiver=3.0.7]

What I suspect is happening is that lsyncd is calling rsync with a list of files all of which get excluded by the filters. Rsync establishes the connection with the server before it realizes that it has nothing to do and then disconnects a bit ungracefully.

So, is there some way to prevent this from happening, ie if rsync has no files to process that it exits without bothering to contact the remote server?

Robert Crida
rcrida at clue.co.za



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20110301/ff6ecd7c/attachment.html>


More information about the rsync mailing list