Adding prompt before overwrite feature in rsync

Scott Wiersdorf scott at
Sat May 11 08:24:55 MDT 2013

On Sat, May 11, 2013 at 09:56:34AM +0530, Lokesh Walase wrote:
> In "cp" command, we have "-i" option, which prompts before overwriting.
> I read the man page of "rsync" and didnt find anything like that here.
> So I m interested in adding this feature to the "rsync" command.
> I have downloaded the source code of "rsync" but I m confused from where to
> start and what to read.

This could turn a large sync into an aborted nightmare; I would
recommend perhaps instead writing a shell script (for example) that
would first do a --dry-run with --itemize-changes, parse that and
present it to the user for confirmation if any file changes are
detected. If the confirmation is given, re-run everything without the
--dry-run, otherwise exit.

Scott Wiersdorf
scott at

More information about the rsync mailing list