HELP: need better understanding of "--delete" flag

Jeff Martin straka2u at
Wed Nov 23 04:08:56 GMT 2005

Need to understand exactly what the "--delete" flag
does when rsync runs. 

Here is my understanding... If a file is created on
the source machine on monday, then rsync'd to the
rsync server on monday night, then deleted on the
source machine tuesday, then it will be deleted from
the rsync server on tuesday night when the cron job
runs again.
But, would rsync under any circumstances, ever delete
files on the source machine?

My log showed a bunch of these statements, and to be
quite honest, scared the living daylights out of me.

(from LOG)
deleting peachbackups/peachw/Peachtree Archive Data
deleting peachbackups/peachw/Peachtree Archive Data

I am using the script from the for 7-day
incremental backups written by tridge.

Here is the part I am not sure what it does...
# the following line clears the last weeks incremental
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
rsync --delete -a $HOME/emptydir/
rmdir $HOME/emptydir

Thanks for any pointers on this.


More information about the rsync mailing list