Huang, YongHui
2006-Mar-28 01:39 UTC
can rsync delete only one file in one command? is it a bug?
I want to call rsync from java webserver in Linux. situation as below: source directory: 001.doc 002.doc /D01/001.doc /D01/002.doc /D01/D11/001.doc /D02/001.doc destination directory: 001.doc 003.doc 004.doc /D01/001.doc /D01/003.doc /D01/004.doc /D01/D11/003.doc /D02/003.doc now, I want to only delete /003.doc when synchronization, no add, no update, This exclude works: rsync -avzu --delete --include="/003.doc" --exclude="*" /home/tomcat/webapps/filesync/synsrc2/ 172.16.100.19::hyhtest2 But, If I want to only delete /D01/003.doc when synchronization, no add, no update, this exclude NOT works: rsync -avzu --delete --include="/D01/003.doc" --exclude="*" /home/tomcat/webapps/filesync/synsrc2/ 172.16.100.19::hyhtest2 nothing was delete or add,update. why it NOT delte /D01/003.doc? is it a bug? how to delete any specify file in any directory and mean while no add or update? thank you. Best Regards --------------------------------------------- yhhuang »ÆÓÂ»Ô Server Dept. TeleNav Shanghai Inc. Tel:(21)6337 2220 ext 8651 www.telenav.com <http://www.telenav.com/> www.telenav.cn <http://www.telenav.cn/> -------------- next part -------------- HTML attachment scrubbed and removed
Wayne Davison
2006-Mar-28 04:21 UTC
can rsync delete only one file in one command? is it a bug?
On Tue, Mar 28, 2006 at 09:39:07AM +0800, Huang, YongHui wrote:> why it NOT delte /D01/003.doc? is it a bug?Nope. Your exclude affected directory D01, so the include has no chance to effect anything. Add a preceding --include=/D01/ and try again. ..wayne..