Re: [Hampshire] rsync

Top Page

Reply to this message
Author: Michael James Daffin
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] rsync
Rsync by default should only copy new/changed files, I tend to run it with
the -a option (archive) which preserves file permissions and owner ship and
copies recursively. The only other options I tend to use are -v (verbossy)
-h (human readably) and -P (--partial --progress, tells me whats currently
copying and how fast and doesn't delete partially copied files if it
is interrupted making it quicker to resume if you are copying lots of large
files). You can also use the --delete option to delete files at the dest
that are not at the source.

I think rsync goes off modification times as its main check so as long as
the source isn't modifying the files it shouldn't transfer them again.

One thing I do note is that the trailing / is important at the source as it
tells rsync to either copy that directory or the contents of that directory.

1) rsync -av foo/ goo/
2) rsync -av --delete foo/ goo/ # this also copies all files on foo that
are not on goo not sure if there is a way to just delete files.

--ignore-existing       skip updating files that exist on receiver
so that should not update files if they already exist (even if they are
newer in the source.



On 5 November 2012 18:32, Rob Malpass <linux@???> wrote:

> Hi all****
>
> ** **
>
> It must be me – but I honestly can’t see a decent guide for rsync. I’d
> be happy to write one as soon as I’ve got it doing what I want. So can
> anyone help?****
>
> ** **
>
> What I’m trying to do is backup my NAS to my NAS backup and (as it’s
> 250Gb) I only want new or changed files copied across. I thought this was
> what the –ignore-existing switch did but I find my latest job copying files
> which I *know* are already there because I can see them if I login from
> another box. Therefore as it’s overwriting them, it’s effectively copying
> the whole 250Gb again which is precisely what I’m trying to avoid.****
>
> ** **
>
> Even more weird (and irritating) if I compare the two sizes (of the source
> and the destination) – then the backup is bigger than the source!
> Therefore you would think there’s some duplication going on somewhere but
> (a cursory inspection) reveals no duplicates.****
>
> ** **
>
> So in the spirit of my sanity, could someone please post the syntax to
> exactly mirror /mnt/foo to /mnt/goo ?****
>
> ** **
>
> And by exactly mirror I mean****
>
> * Copy all files on foo which are not on goo****
>
> * Delete all files on goo which are not on foo****
>
> ** **
>
> Cheers****
>
> Rob****
>
> --
> Please post to: Hampshire@???
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --------------------------------------------------------------
>




--
Michael Daffin <james1479@???>
--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------