Delete old files?

tim.conway at tim.conway at
Wed Jun 26 08:50:02 EST 2002

Brad:  By default, rsync does not propogate deletions.  In order to do 
that, you must specify the "--delete" option.
Relevant section of manpage:

          --delete                delete files that  don't  exist on the 
sending side
          --delete-excluded       also delete excluded  files  on the 
receiving side
          --delete-after          delete after transferring,  not before
          --ignore-errors         delete even  if  there  are  IO errors
          --max-delete=NUM         don't  delete  more  than  NUM files
          --partial                keep   partially   transferred files
          --force                 force deletion  of  directories even if 
not empty

SunOS 5.7            Last change: 1 Mar 1999                    6

User Commands                                            rsync(1)
You may want to use --force (which also handles the case where a directory 
full of files is replaced by a symbolic link where the same files are, i 


Tim Conway
tim.conway at
303.682.4917 office, 3039210301 cell
Philips Semiconductor - Longmont TC
1880 Industrial Circle, Suite D
Longmont, CO 80501
Available via SameTime Connect within Philips, n9hmg on AIM
perl -e 'print pack(nnnnnnnnnnnn, 
".\n" '
"There are some who call me.... Tim?"

Brad <rsyncuser at>
Sent by: rsync-admin at
06/25/2002 07:49 PM

        To:     Rsync Mailing List <rsync at>
        cc:     (bcc: Tim Conway/LMT/SC/PHILIPS)
        Subject:        Delete old files?

I have Rsync working ok, backing up some server directories onto another 
server each evening. If I do an rsync back up of a directory - called 
for example - and in the "test" directory there is a file called 
it gets backed up OK.

However, if that file, "testfile" gets deleted from the original "test" 
directory, when I run rsync again and the backup completes, "testfile" is 
copied, but it still remains on the destination rsync server from the last 

rsync backup before it was deleted. And so over time as files are deleted 
from the orginal "test" directory, the backup destination directory will 
become more and more out-of-date, with lots of old and deleted files 

Other than deleting all the files in the destination directory before 
rsync is 
run, is there any way to ensure that the backed up (destination) directory 
exactly the same as the current live "test" directory?

Brisbane, Australia

To unsubscribe or change options:
Before posting, read:

More information about the rsync mailing list