--delete-before doesn't seem to actually be deleting before transfer

Matthias Schniedermeyer ms at citd.de
Tue Jul 14 05:41:32 MDT 2009

On 14.07.2009 13:01, Tim Edwards wrote:
> I have a script transferring some backup files onto a USB stick, which
> has limited space. I use rsync 3.0.5 with the following command:
> rsync -av --delete-before /local/backups/dir/backup1_todaysdate
> /local/backups/dir/backup2_todaysdate
> /local/backups/dir/backup3_todaysdate /USBstick/backups/dir
> The USB stick runs out of space if more than 1 backup set is put on it,
> so I'd assumed that by using the --delete-before option would first
> scrub /USBstick/backups/dir of any files that I hadn't listed to be
> transfered - is this how it works? Because it doesn't seem to work that
> way - I have to manually delete the old backups from the USB stick
> before transferring the new.

I think you have more of a problem with how rsync updates a changed file 
than with --delete-before.

See --inplace in the man-page.

Without --inplace, you temporarily need as much additional free space as 
the biggest (changed) file.

Bis denn

Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.

More information about the rsync mailing list