Patch to revive tmpfiles

jw schultz jw at
Thu Oct 9 06:56:12 EST 2003

On Mon, Oct 06, 2003 at 03:22:04PM +0200, Hans Eric Sandström wrote:
> This is a patch to fix one annoyance of having rsync processes race:
> I usually keep our servers synced with the following script, run by cron.
> #!/bin/sh
> lockfile -r 2 -l 1000 /tmp/synchome.lock || exit 1
> rsync -e ssh -avHP --delete zorro01:/home/\* /home >/dev/null
> rm -f /tmp/synchome.lock
> --
> Sometimes my users (including myself) are in a hurry and syncronise files and directories in their homes themselves. This bypasses the lock above and two or more rsync processes are in a race.
> What happens is that the competing rsync processes delete each others temporary files a lot of network traffic is wasted since rsyncing fails when the temp file is deleted.
> The included patch tries to remedy this situation by reviving the temp file.

Interesting idea.  Very platform dependant though.


	J.W. Schultz            Pegasystems Technologies
	email address:		jw at

		Remember Cernan and Schmitt

More information about the rsync mailing list