7

Based on the manpage:

--delete-during, --del

Request that the file-deletions on the receiving side be done incrementally as the transfer happens. The per-directory delete scan is done right before each directory is checked for updates, so it behaves like a more efficient --delete-before, including doing the deletions prior to any per-directory filter files being updated. This option was first added in rsync version 2.6.4. See --delete (which is implied) for more details on file-deletion.

There's also --delete-before and --delete-after. I don't exactly understand the difference between these and --delete. When does --delete delete files, if not before, during, or after?

The docs also say:

Because of this, the default delete mode when you specify --delete is now --delete-during when both ends of the connection are at least 3.0.0 (use --del or --delete-during to request this improved deletion mode explicitly).

I suppose that means that --del is intended to supercede --delete. Is there any reason to use --delete over --del? Could using --del cause problems in connections that are less than 3.0.0? (I assume this is the rsync version).

1

1 Answer 1

11

With --delete-after then the process will send over all the files that need adding/changing and then when that's complete it will delete all the files that are unnecessary. This can be useful because it means that the target always has a copy of all the files; if the transfer is interrupted then nothing has been lost. However if you're transferring large files (eg offsite backups) then you might temporarily need more space to hold the old file and the new file at the same time.

With --delete-before then the process will delete the files before the transfer has started; this will mean that you don't need a lot of temporary space but if the transfer is interrupted then you might not have a copy of any file on the remote end.

With --del or --delete-during then it will delete files in each directory as it comes to them; it's a half-way house between before and after and is more efficient; it suffers partially from the "before" but it's limited to the one directory (so less chance of data loss).

--delete will default to --delete-during if talking to a server 3.0.0 or higher, and --delete-before if talking to an older version. Because of this I'd recommend just using --delete unless you have specific tuning needs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .