Unruh wrote:
Quote:
Matt Giwer writes:
Maurice Batey wrote:
On Thu, 20 Aug 2009 02:39:56 -0400, Matt Giwer wrote:
What I would like would be an automatic exact mirror which erases files which
no longer exist in the destination directory.
I assume you mean "erase files in the destination
(backup) directory that no longer exist in the source
directory" (and replace files that have been superseded).
I do this on a regular basis to backup my root (hdb5) and /home
directories (using a LiveCD) onto an external drive.
mkdir /old /new
mount -t auto /dev/hdb5 /old
mount -t auto /dev/sda1 /new
time rsync -avx --delete --progress /old/ /new
umount /old /new
N.B. "/old/" implies "the contents of the directory /old".
Regret the delay that does almost what I wanted. The addition of -u does
exactly what I wanted.
rsync -avxu --delete --progress /old/ /new
It's a backup. Why would there be newer versions of the file on the
backup than on the original? Where do they come from?
They come from me changing them manually. After changing them I want a backup
reflecting my changes with an exact copy. Doesn't sound like something all
that important but I found all the dupes added up when I was converting say
..flac to .mp3 and the deleting the former.
Quote:
Someone said I was not clear which is not unusual. My need was to be able to
manually reorganize an existing directory and back it up for an exact copy.
Say I would make a cp -R copy of a directory and them later modify the
original directory simply moving a file to another directory. Doing another cp
operation would leave the file in the old directory and add a copy to the
other directory. The same with changing file names. Old and new name would
appear in the backup directory.
In rsync the --delete removes the file from the old directory and eliminates
the old name while adding the new name. The -u is added as without it rsync
recopies all the old files even if unchanged. -u only copies those which have
been changed --updated.
Complete nonesense. rsync does not recopy old files if they are the same
on the backup as on the original ( you may see their names flashing
past, but that just means that they are being checked, not copied, as
you will notice when a 100GB file takes less than a second to update)
Also it sounds as if your backup computer has time problems In the
first instance it looks at the date and size of the file to determine
whether or not to check that the file has changed.
What -u does is if the timestamp on the backup is later than the
timestamp on the original, then it is not checked. Sounds like you have
time problems on your machines. Run chrony or ntp to keep the times on
the various machines accurate.
I have no idea what rsync you are using nor what options you may invoke as a
default. I am using the one that came with Fedora 10. I used the switches I
posted. I only report what happened when I used it.
Perhaps we are not communicating. I ran the test twice without the -u. Both
times it recopied the source file. The man page says -u prevents that and
only updates rationally. I tried it with the -u and it worked. I kept the -v
in all three tests and that is what it reported it was doing.
I am not looking to claim I know more than anyone else. Anyone who wants can
try it as originally posted and as I suggest, that is only with and without
-u. It is not like it matters or that it can hurt anyone to try the -u.
Your Mileage WILL Vary.
--
Lebanon became a democracy in 1943, five years before Jews started claiming
they had the first and only democracy in the Middle East.
-- The Iron Webmaster, 4172
http://www.giwersworld.org/environment/aehb.phtml a2
Sun Sep 6 05:36:53 EDT 2009