Delete source folder?

Matt McCutchen matt at mattmccutchen.net
Wed Nov 26 22:14:36 GMT 2008


On Wed, 2008-11-26 at 18:33 +0100, Jeroen van der Vegt wrote:
> We're using rsync to move files from a server to a client (an embedded
> device, connected over GPRS) using a cron script on the client. To
> accomplish this, we use the --delete-source-files option.  As I found in the
> archives, this doesn't remove any folders. Is there a way to have rsync
> remove the folders as well?

Not currently.  You can join this enhancement request:

https://bugzilla.samba.org/show_bug.cgi?id=3845

> As all data flows over the internet, we encrypt it using an SSH tunnel. This
> tunnel is setup once, and then reused for several rsync sessions, like this:
>  
> rsync --port <forwarded local port> localhost::share/* /tmp/source/
> 
> That rules out any --rsync-path= trickery, right?

Yes, but the daemon "post-xfer exec" parameter gives you essentially the
same functionality.

> The reason we'd like to reuse the SSH tunnel is that we need a tunnel anyway
> for other tools, and SSH-authentication is rather slow (it takes about 10
> seconds). This make something like "rsync -e 'ssh user at remotehost'" even
> slower.

It may help to use ssh's ControlMaster feature, which lets an ssh
command piggyback on an existing ssh connection to the same
user at remotehost without re-authenticating.  That way, as long as you
leave the port-forwarding ssh (or any other ssh) running, further
"ssh user at remotehost" commands will be faster.

Matt



More information about the rsync mailing list