Local and remote back up behave differently

Kevin Korb kmk at sanitarium.net
Sun Aug 25 15:11:17 MDT 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rsync has no concept of what has changed since the last run.  In
either case it is going to find the differences and copy them from the
source to the target.  -u tells it not to do that to files that have
been touched more recently than on the source.

On 08/25/13 17:09, David Highley wrote:
> "Kevin Korb wrote:"
>> 
> I am not sure what you are trying to do here.  -u is not the 
> difference between a complete and differential copy.  Rsync always 
> skips copying stuff that is already there and hasn't changed.  The
> -u just tells it not to overwrite new files with older versions
> which is something you shouldn't have in a backup anyway.
> 
> The big difference between rsyncing locally vs to a remote system
> is that rsync forces --whole-file when running locally.
> 
>> Want a complete back up on Mondays and only files that have
>> changed on the other days, incremental. The script seems to work
>> correctly for remote back ups, but not local back ups. Local back
>> ups always seem to be a complete back up.
> 
> 
> On 08/25/13 16:38, David Highley wrote:
>>>> I have run out of ideas on why the local and remote back ups
>>>> done with the script below behave differently. The local
>>>> always seems to be a complete back up while the remotes are
>>>> delta back ups except on Mondays.
>>>> 
>>>> Cron line example: /root/bin/backups /export/home redwood 
>>>> "--exclude='*.sock' --exclude='*cache*' 
>>>> --exclude=/export/home/*/.gvfs"
>>>> 
>>>> 
>>>> #!/bin/bash
>>>> 
>>>> # Script for one week incremental rsync back up scheme.
>>>> 
>>>> if [ $# -lt 2 ]; then echo "Usage: $name source server [
>>>> filters, --exclude ]" >&2 exit 1 fi
>>>> 
>>>> trap cleanup 2 3 6 9 10 12 13 15 16 17 18 19 20 23 24 30 31
>>>> 
>>>> # Get our script name, the source directory to be transfered,
>>>> # server to send to, and optional filtering, --exclude. 
>>>> name=`basename $0` base=`basename $1` source=$1 server=$2 if
>>>> [ $# -eq 3 ]; then filters=$3 fi
>>>> 
>>>> # Day of week, 1 to 7. day=`/bin/date '+%u'`
>>>> 
>>>> # Set the options to be used, using -X is not useful with
>>>> selinux. # Archive with hard links all attributes and
>>>> relative paths. # Run verbose, can create a cron log message
>>>> to big for email. # Day of week, 1 to 7; where Monday is 1.
>>>> #if [ ${day} -eq 7 ]; then do a full backup if [ ${day} -eq 7
>>>> ]; then options='-qaHAR' else options='-qauHAR' fi
>>>> 
>>>> # Signal handler for abort clean up of lock file. cleanup() {
>>>> echo "Caught Signal removing lock file
>>>> /tmp/${name}.${base}.${server}"
>>>>> &2 rm -f /tmp/${name}.${base}.${server} exit 0 }
>>>> 
>>>> if [ ! -d "${source}" ]; then echo "Source ${source} not
>>>> found." exit 2 fi
>>>> 
>>>> # Get this systems hostname and # check if we are backing up
>>>> to the # system the script is running on. ItIsI=`uname -n` if
>>>> [ "${server}" = "${ItIsI}" ]; then if [ -d /backups ]; then 
>>>> dest="/backups/${server}" options+="
>>>> --backup-dir=${source}.${day}" else echo "Directory /backups
>>>> does not exist." exit 3 fi else # Set a time out in case the
>>>> server goes away. # We are using hostname for the rsync
>>>> module parameter. dest="${server}::${ItIsI}" options+="
>>>> --contimeout=300 --backup-dir=${source}.${day}" # Test if we
>>>> can talk to back up server. ping -c 1 ${server} >/dev/null 
>>>> 2>&1 if [ $? -ne 0 ]; then echo "Could not ping server
>>>> ${server}"
>>>>> &2 exit 4 fi fi
>>>> 
>>>> # Use flock file to prevent overlap per source, ${1}. flock
>>>> -xn /tmp/${name}.${base}.${server} \ -c "rsync ${options}
>>>> ${filters} --ignore-errors --delete-excluded --delete
>>>> --delete-during ${source} ${dest}"
>>>> 
>>>> rm -f /tmp/${name}.${base}.${server}
>>>> 
>>>> exit 0
>>>> 
> 
>> -- Please use reply-all for most replies to avoid omitting the
>> mailing list. To unsubscribe or change options:
>> https://lists.samba.org/mailman/listinfo/rsync Before posting,
>> read: http://www.catb.org/~esr/faqs/smart-questions.html
>> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin at FutureQuest.net  (work)
	Orlando, Florida		kmk at sanitarium.net (personal)
	Web page:			http://www.sanitarium.net/
	PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlIacvUACgkQVKC1jlbQAQdPvACfVSH+JW40RrJi1Ll5MMOW0CBl
MMwAoLjdXKH6dC7DeX7diXn7tkPM3336
=ONpr
-----END PGP SIGNATURE-----


More information about the rsync mailing list