Re: [Hampshire] rsync help needed

2011-02-13 Thread Chris Dennis

On 12/02/11 11:48, john lewis wrote:

On Fri, 11 Feb 2011 18:49:19 +
James Courtier-Dutton  wrote:



rsync is good so I think the problem is elsewhere.


I think I am getting somewhere with the syntax of the rsync command
line, I am trying the following

-vv verbose
-g  preserve group
-W  send whole files
--exclude-from=$EXCLUDES

the last is one I'm not sure of, does the 'exludes' apply at both ends?
I have created an 'excludes' file listing certain files in the local
database which I don't want copied to the remote database, but I don't
want to delete any files with same names in the remote database.

or should I use?
--n--delete


rsync is fairly foolproof -- it only deletes things if you ask it to. 
i.e. it doesn't delete anything unless you use one of the --delete... 
options.  (I know the man page says that --delete-before is the default, 
but it just means that 'before' is the default time to do deletes IF 
you're deleting anything.)


Only files/and directories that are not excluded are copied.  If you 
switch on deletions, only directories that are not excluded are 
candidates for any of their contents to be deleted.


For general use, all you need is

   rsync -av src dest

If you're copying a directory with hard links, or a whole system that 
includes obscure things like pipes and devices, then use


   rsync -avHAX src dest

And if you want more information about which files are being copied and 
which are already up to date on the destination, then -i 
(--itemize-changes) is more helpful than -v.


cheers

Chris
--
Chris Dennis  cgden...@btinternet.com
Fordingbridge, Hampshire, UK

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] rsync help needed

2011-02-12 Thread john lewis
On Fri, 11 Feb 2011 18:49:19 +
James Courtier-Dutton  wrote:


> rsync is good so I think the problem is elsewhere.

I think I am getting somewhere with the syntax of the rsync command
line, I am trying the following

-vv verbose
-g  preserve group 
-W  send whole files
--exclude-from=$EXCLUDES

the last is one I'm not sure of, does the 'exludes' apply at both ends? 
I have created an 'excludes' file listing certain files in the local
database which I don't want copied to the remote database, but I don't
want to delete any files with same names in the remote database.

or should I use?
--n--delete

> Some ideas to help diagnose the problem.
> One easy way to test if rsync is doing the job is to do
> sha256sum -b *  >sha256sum.txt
> 
> This should create a file containing all the checksums of the files in
> the current directory.

Presumably the checksum calculated by 'sha256sum -b * sha256sum.txt'
will only be valid so long as the original files have not been amended,
so only of value one time

> You then rsync all the files to the remote server.
> You then do on the destination server.
> sha256sum -c
> 
> This will check with a high level of certainty that the file both
> local and remote are identical.
> 
> When you do the rsync from the database, I would not compress the
> backup of the database.
> This will let rsync send less data after the first initial transfer.
> 
> Regards
> 
> James
> 
> --
> Please post to: Hampshire@mailman.lug.org.uk
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --

-- 
John Lewis
using Debian sid 

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] rsync help needed

2011-02-11 Thread James Courtier-Dutton
On 11 February 2011 18:36, john lewis  wrote:
> I have been reading the rsync documentation and it has left me
> confused as there is so much of it and so many permutations. I need
> help to work out the correct 'spell'
>
> I keep my geneweb database on a local headless server and do all my
> updating of the database on that system. The database lives
> in /var/lib/geneweb/mybase. There are 9 binary files and several
> text files which don't change very often.
>
> I need to 'copy' those files to my remote geneweb server on a daily
> basis so the public database is in sync with my local database.
>
> I have been doing this by using the built-in geneweb tools for
> backing-up the data, using scp to copy the back-up file, which is plain
> text, to the remote server, then doing a restore there to get the
> latest version,
>
> For some reason, which may be down to the fact I am  using squeeze on
> the local server but haven't updated the remote server which is still
> on lenny, restoring from a backup isn't working (it does work on the
> local server if I restore to a test database)
>

rsync is good so I think the problem is elsewhere.
Some ideas to help diagnose the problem.
One easy way to test if rsync is doing the job is to do
sha256sum -b *  >sha256sum.txt

This should create a file containing all the checksums of the files in
the current directory.
You then rsync all the files to the remote server.
You then do on the destination server.
sha256sum -c

This will check with a high level of certainty that the file both
local and remote are identical.

When you do the rsync from the database, I would not compress the
backup of the database.
This will let rsync send less data after the first initial transfer.

Regards

James

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--