Using rsync to just -resync permissions and ownership?

Kevin Korb kmk at sanitarium.net
Tue May 14 18:57:33 MDT 2013


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

OK, since your timestamps are all a mess you have 2 choices...

1. Assume that all files on one system are correct and rsync --archive
from it to the other.  Rsync will go through all the data but it will
only actually transfer the differences.  It will take time but less
time than actually re-copying everything.

2. Same as the above but add --size-only to rsync.  This will tell
rsync to assume that files that are the same size on both systems are
actually the same.  Usually files that are the same size actually are
the same but obviously that isn't a guarantee so this can create cases
of old data with new dates.

- From now on always copy timestamps!

On 05/14/13 20:50, Carl Brewer wrote:
> On 15/05/2013 10:38 AM, Kevin Korb wrote:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>> 
>> If the timestamps are the same then rsync with -a should just fix
>> the ownerships and permissions.
> 
> That doesn't seem to deal with older files though, which is most
> of them, at least as far as I can tell.  Most of the files now on
> the "new" server are newer than the ones coming off the original as
> I've shunted them around with a mix of tar and rsync's so all my
> timestamps and permissions are a mess.
> 
>> 
>> If the timestamps are not the same then you could do it with
>> getfacl and setfacl as they can use a text file as an
>> intermediary however your next question is going to be what to do
>> about the timestamps. Which generally means resorting to
>> --size-only or just letting rsync re-hash the data.
> 
> Any chance of an example?  I'm not really sure how this would
> work.
> 
> rsync --just-perms --everything old new: would be awesome :)
> 
> 
> 
> 
> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
	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.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlGS3X0ACgkQVKC1jlbQAQdeZwCfUA1xxMEUL+jQqXDhfGpQkOe6
wm0An0LgnFA7xPDslL/6PNaGtp5+oC/Y
=AX25
-----END PGP SIGNATURE-----


More information about the rsync mailing list