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
think).
Cheers,
Tim Conway
tim.conway@philips.com
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,
19061,29556,8289,28271,29800,25970,8304,25970,27680,26721,25451,25970),
".\n" '
"There are some who call me.... Tim?"
Brad <rsyncuser@sportingwheelies.org.au>
Sent by: rsync-admin@lists.samba.org
06/25/2002 07:49 PM
To: Rsync Mailing List <rsync@lists.samba.org>
cc: (bcc: Tim Conway/LMT/SC/PHILIPS)
Subject: Delete old files?
Classification:
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
"test",
for example - and in the "test" directory there is a file called
"testfile",
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
not
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
there.
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
is
exactly the same as the current live "test" directory?
Regards,
Brad
Brisbane, Australia
--
To unsubscribe or change options:
http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html