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

Jeff Martin straka2u at yahoo.com
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
Files/archivec/W200001.FRM
deleting peachbackups/peachw/Peachtree Archive Data
Files/archivec/W200000.FRM
.........


I am using the script from rsync.org 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
directory
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
rsync --delete -a $HOME/emptydir/
$BSERVER::$USER/$BACKUPDIR/
rmdir $HOME/emptydir

Thanks for any pointers on this.

-Jeff





More information about the rsync mailing list