Hello list, I have the following problem for awhile now. A backup script is running on server Backup. Every night a complete backup of /home is made of server Server, using rsync over SSH. (rsync version 3.0.2 on Debian/Linux) Now. There is one user, that has a NFS mount in his homedirectory on Server "/home/username/mnt". This user uses NFS to access his laptop's filesystem. At night the laptop is not connected, so the mountpoint is not accessible: root@server:~# mount 10.0.0.217:/Users/username/Development on /home/username/mnt/dev (nfs) To prevent errors with rsync, I exclude the directory, using this option: --exclude=/home/username/mnt However, even though I exclude this directory, rsync still attempts to access it: 2008/08/06 01:05:41 [23001] receiving file list 2008/08/06 01:27:44 [23001] rsync: readlink "/home/username/mnt/dev" failed: Operation timed out (60) 2008/08/06 01:34:57 [23001] IO error encountered -- skipping file deletion The manpage says that using the exclude option, will prevent it from traversing beneith an exclude-path. Since I exclude /home/username/mnt, howcome it times out on /home/username/mnt/dev? Is there a solution? Other than lazy-unmounting the NFS filesystem? -- Rob klein Gunnewiek BWSS B.V. Deventer (http://www.bwss.nl) Tel +(31) 0570-665140 Fax +(31) 0570-665141
On Thu, Aug 07, 2008 at 10:53:34AM +0200, Rob klein Gunnewiek wrote:> However, even though I exclude this directory, rsync still attempts to > access it:Yes, this has come up before. The current exclude code wants to know in advance if the items is a directory so that it knows which rules apply to the name and which don't. Because of that rsync, will stat every file before checking to see if it is excluded. If the exclude code was rewritten to take a name and return two results, one for dirs and one for non-dirs, then the name could be excluded prior to a stat call anytime that the two results agreed on exclusion. I'm going to look into such an implementation and possibly include it in 3.1.0. In the meantime, there your options are: (1) exclude the parent dir of the mount (/home/username/mnt), which will prevent rsync from ever trying to stat the mount itself, (2) change the current mount to a symlink to a mount, and move the actual mount to a place where you can exclude its parent directory, or (3) create a way for the laptop-user to unmount that mount prior to leaving and remount after arriving. ..wayne..