Post subject: speaking of rsync
PostPosted: Thu Aug 20, 2009 1:39 pm 
   
I have a directory of literally thousands of files which started poorly to un
organized. These are important to me as reference material but organization is
very helpful. So I back them up and, as time permits, work on organizing them.
Part of my organizing is making files by date such as

02 August 2009

2 August 2009

2 Aug 2009

2 08 2009

2 08 09

and a host of others all in the same format.

In backing up to a different drive for a mirror I use this command

cp -Ru $1 .

This works fine. I can go to the top level backup directory and run this and
get every change even those I have forgotten. Problem is when I change the
name of a file the old name is not removed. So I erase the destination
directory and then run the above command.

What I would like would be an automatic exact mirror which erases files which
no longer exist in the destination directory.

I have been reading about rsync in a current discussion but man rsync looks
like a major commitment of time. Before I do that, does anyone know how to do
this?

By this I mean an exact mirror which adds changed files and deletes those
which no longer exist.

Or is my problem that that is what rsync does and the options are to stop it
from doing that?

--
There are only two kinds of Jews. Those who
love Israel and those who hate themselves.
-- The Iron Webmaster, 4179
http://www.giwersworld.org/holo3/holo-survivors.phtml a3
Thu Aug 20 02:23:40 EDT 2009


 
 Post subject: Re: speaking of rsync
PostPosted: Thu Aug 20, 2009 2:17 pm 
On Thu, 20 Aug 2009 02:39:56 -0400, Matt Giwer wrote:

Quote:
I have a directory of literally thousands of files which started poorly to un
organized. These are important to me as reference material but organization is
very helpful. So I back them up and, as time permits, work on organizing them.
Part of my organizing is making files by date such as

02 August 2009

2 August 2009

2 Aug 2009

2 08 2009

2 08 09

and a host of others all in the same format.

In backing up to a different drive for a mirror I use this command

cp -Ru $1 .
This works fine. I can go to the top level backup directory and run this and
get every change even those I have forgotten. Problem is when I change the
name of a file the old name is not removed. So I erase the destination
directory and then run the above command.

Me confused by above..
Quote:
What I would like would be an automatic exact mirror which erases files which
no longer exist in the destination directory.

...and this. You want rsync to not create any new files, update only
existing ones?
Quote:
I have been reading about rsync in a current discussion but man rsync looks
like a major commitment of time. Before I do that, does anyone know how to do
this?

What, verifying some random input from usenet invloves no commitment?
Quote:
By this I mean an exact mirror which adds changed files and deletes those
which no longer exist.

See the '--delete' option, or:

--remove-source-files sender removes synchronized files (non-dir)
--del an alias for --delete-during
--delete delete extraneous files from dest dirs
--delete-before receiver deletes before transfer (default)
--delete-during receiver deletes during xfer, not before
--delete-after receiver deletes after transfer, not before
--delete-excluded also delete excluded files from dest dirs
--man rsync

Grant.
--
http://bugsplatter.id.au


 
 Post subject: Re: speaking of rsync
PostPosted: Thu Aug 20, 2009 10:32 pm 
Matt Giwer writes:

Quote:
I have a directory of literally thousands of files which started poorly to un
organized. These are important to me as reference material but organization is
very helpful. So I back them up and, as time permits, work on organizing them.
Part of my organizing is making files by date such as

02 August 2009

2 August 2009

2 Aug 2009

2 08 2009

2 08 09

and a host of others all in the same format.

In backing up to a different drive for a mirror I use this command

cp -Ru $1 .
This works fine. I can go to the top level backup directory and run this and
get every change even those I have forgotten. Problem is when I change the
name of a file the old name is not removed. So I erase the destination
directory and then run the above command.

What I would like would be an automatic exact mirror which erases files which
no longer exist in the destination directory.

I have been reading about rsync in a current discussion but man rsync looks
like a major commitment of time. Before I do that, does anyone know how to do
this?

By this I mean an exact mirror which adds changed files and deletes those
which no longer exist.

Or is my problem that that is what rsync does and the options are to stop it
from doing that?

Look at rsapshot which does what you want, and has the advantage of
using hard links for files which have not changed.
It is not clear to me whether you want just a single backup or you want
to be able to recover from changes you have made.
You could simply do a two level rsnapshot if you wanted the former.


 
 Post subject: Re: speaking of rsync
PostPosted: Thu Aug 20, 2009 11:50 pm 
On Thu, 20 Aug 2009 02:39:56 -0400, Matt Giwer wrote:

Quote:
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".
--
/\/\aurice
(Replace "nomail.afraid" by "bcs" to reply by email)


 
 Post subject: Re: speaking of rsync
PostPosted: Thu Aug 27, 2009 12:14 pm 
Maurice Batey wrote:
Quote:
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".

I will be trying it. Thank you.

--
If you believe religion to be infallible be thankful your
neighbor is not a man of the cloth.
-- The Iron Webmaster, 4189
http://www.giwersworld.org/00_files/zio ... ints.phtml a16
Jews stole the land. The owners want it back. a16
Thu Aug 27 01:13:26 EDT 2009


 
 Post subject: Re: speaking of rsync
PostPosted: Sun Sep 06, 2009 10:36 am 
Maurice Batey wrote:
Quote:
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

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.

--
Hodie Nonis Septembribus MMIX est
-- The Ferric Webcaesar
http://www.giwersworld.org/israel/bombings.phtml a5
Sat Sep 5 23:27:39 EDT 2009


 
 Post subject: Re: speaking of rsync
PostPosted: Sun Sep 06, 2009 12:20 pm 
Matt Giwer writes:

Quote:
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?



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.


 
 Post subject: Re: speaking of rsync
PostPosted: Sun Sep 06, 2009 4:48 pm 
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


 
 Post subject: Re: speaking of rsync
PostPosted: Mon Sep 07, 2009 12:49 am 
Matt Giwer writes:

Quote:
Unruh wrote:
Matt Giwer writes:
....
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

You changed them manually on the backup? Not on the original? Why would
you do that?

Quote:
reflecting my changes with an exact copy. Doesn't sound like something all

That sounds like you changed the original. Fine, rsync will make sure
that all of those changes are also made on the backup.


Quote:
that important but I found all the dupes added up when I was converting say
.flac to .mp3 and the deleting the former.

??? That is a complete change of files. rsync will get those without the
-u, unless you are making those changes on the backup and not the
originals. If that is what you are doing, then -u is apprpriate (
especially with the --delete option)



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.

No it did not.
The way rsync as a default works is to compare the times on the original
and backup and compares the sizes of the two files. If both are the same
( to within 2 sec I believe) that file is skipped entirely. If they are
not the same, then rsync runs a sequential MD4 over the two files to
discover which parts of the two files have have changed. If nothing has
changed, nothing is transfered. If something has changed only that
something is transfered. However, even if nothing is transfered the file
name is listed as being processed, not transferred on the -v option.

Ie, just because a filename is listed under -v does NOT mean that
anything is transferred. It just means that file is checked.



Quote:
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.

Since I use rsync to make backups every night with 100GB of data, I have
some familiarity with how it works. IF you are making backups, -u is a
bad idea. If the clocks are out on the two systems so that the times on
the backups are slightly later, then rsync will not replace the file
even if it is totally different. Ie, -u will destroy your backups.
It WILL hurt.


 





SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list
  0x61.com 2009-2010 - Internet Forums and much more!