All of the rsync pages say that "rsync -a --delete src dest" will do a full mirror but it just isn't so for us. I've only found one Google item similar: http://www.linuxquestions.org/questions/linux-software-2/rsync-doesnt-seem-to-delete-599985/ We have around 9200 directories in 250G in /home on a Sun 4500 with Solaris 8 and rsync 2.6.5 - which we are trying to mirror on Sun and Linux. Around 1,200 directories were removed from /home but they were not removed from the mirrors after rsync ran. We have tried: 1) rsync, via rsh, to a second similar machine rsync -az -e rsh --delete /home Solaris_box_2:/home2 2) rsync, via ssh and via port 873 to a Centos 5.0 box with rsync 2.6.9 rsync -a -e ssh --delete Solaris_box:/ /home ssh Solaris_box "cd /home;rsync -az --force --delete * Centos_Box::remote_mach" ssh Solaris_box "rsync -az --force --delete /home Centos_Box::remote_mach" In all cases rsyncing the original file system copies all files; but files and directories removed are not reliably removed from the rsync mirror. It takes around 4 hours to build a file list - blech! On Centos_Box (rsync Solaris NFS mount to local mirror) rsync -azv --delete /Solaris_NFS_mount/* /home root@CentosBox# ls /home | wc; ls /Solaris_NFS_mount | wc 9338 9338 72420 7168 7168 55792 Try Solaris to Solaris: rsync -az -e rsh --delete /home Solaris_box_2:/home2 root@Solaris_box_2 ls /home2 | wc; ls /home | wc 8925 8925 78292 7168 7168 62960 Yea they're all in various stages of dirtyness. Does anyone have a clue what's up? Is this an issue with the amount of data (250G) or the number of files aprox 750,000) we have? Thanks, - Eric
On Thu, Nov 22, 2007 at 04:01:29PM -0500, Eric Praetzel wrote:> ssh Solaris_box "cd /home;rsync -az --force --delete * Centos_Box::remote_mach" > ssh Solaris_box "rsync -az --force --delete /home Centos_Box::remote_mach"Those are two very different things -- the first copies items from inside the /home dir (and usually only non-dot names), and the latter copies the /home directory itself, which will put all the copied items an extra level deep (you probably wanted a trailing slash after /home).> In all cases rsyncing the original file system copies all files; but files > and directories removed are not reliably removed from the rsync mirror.See the manpage for why you should never use a wild-card with delete (use '.' instead).> It takes around 4 hours to build a file list - blech!Rsync 3.0.0 (in pre-release testing) doesn't have this problem due to its incremental recursion algorithm. ..wayne..
At 12:54 04.12.2007 -0800, Wayne Davison wrote:>On Thu, Nov 22, 2007 at 04:01:29PM -0500, Eric Praetzel wrote: >> ssh Solaris_box "cd /home;rsync -az --force --delete * Centos_Box::remote_mach" >> ssh Solaris_box "rsync -az --force --delete /home Centos_Box::remote_mach" > >Those are two very different things -- the first copies items from >inside the /home dir (and usually only non-dot names), and the latter >copies the /home directory itself, which will put all the copied items >an extra level deep (you probably wanted a trailing slash after /home).But then rsync won't delete folders that disappeared in /home, like /home/someuser. This gets only deleted if rsync starts a level above, right? bye Fabi