rsync, trailing slash, and --delete

BJ Quinn bjquinn at
Thu Aug 11 14:20:10 MDT 2011

Thanks for the response. I tried a few simple tests myself and it does indeed appear to work. Seems like a few years ago I was able to reproduce the behavior described at which says that if you use a trailing slash then --delete won't delete top-level directories. Maybe it's been fixed with newer rsync's, or maybe I was confused all along? Either way, it appears to work. 

-BJ Quinn 

----- Original Message -----

From: "Kevin Korb" <kmk at> 
To: rsync at 
Sent: Thursday, August 11, 2011 2:14:53 PM 
Subject: Re: rsync, trailing slash, and --delete 

Hash: SHA1 

delete will still work. 

On 08/11/11 15:06, BJ Quinn wrote: 
> I'm trying to rsync a folder like so - 
> rsync -aP --delete /home/share_20110801 /lastbackup/share 
> Under the /lastbackup folder there is a "share" folder. I'd like to 
> rsync all the contents of the "share _20110801" folder directly under 
> the the "share" folder under /lastbackup. I know I can add the trailing 
> slash to the source directory to accomplish this, but then as I 
> understand it --delete won't work in that top-level directories deleted 
> in the source won't be deleted in the destination. Is there any way to 
> rsync from a folder to a differently named folder without breaking --delete? 
> Thanks! 
> -BJ Quinn 

- -- 
Kevin Korb Phone: (407) 252-6853 
Systems Administrator Internet: 
FutureQuest, Inc. Kevin at (work) 
Orlando, Florida kmk at (personal) 
Web page: 
PGP public key available on web site. 
Version: GnuPG v2.0.17 (GNU/Linux) 

Please use reply-all for most replies to avoid omitting the mailing list. 
To unsubscribe or change options: 
Before posting, read: 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rsync mailing list