Re: slow rsync backup
"Birger" <Birger.forums.only@norsborg.net> skrev i melding
news:sIXRg.566$0h7.147@prv-forum2.provo.novell.com...
> Dag Ringdal wrote:
>> hi,
>>
>> I'm fairly new to rsync, but I'm up and going with the program. I have
>> mounted a windows catalogue tree on my linux box. I run the command for
>> backup like this:
>>
>> #rsync -rtv --progress --size-only --delete /source/folder /target/folder
>>
>> The first time I ran the command, all the files were properly copied to
>> the
>> target folder. The next time I ran the command, it seems from the time
>> consumed, that the files were copied once more. It took several hours to
>> do
>> the second backup. I thought rsync only copied the files which were
>> changed.
>> Should I have an -a in the line, or is it just like this rsync works?
>>
> Rsync will only update the differences when it works as expected.
>
>
> I don't know exactly how to do this since I don't use windows myself,
> but I know it's a big problem with timestamps windows<->linux/unix.
>
> Windows use localtime for everything, while linux use utc based times,
> where the correct localtime is displayed for you depending on your TZ.
> And in some cases TZ can be different at src <-> dest
> So if I from Sweden rsync a file with date 2006-09-25 22:58 to Japan ,
> they will see the date as 2006-09-26 05:58 , this is a big difference
> compared with windows.
>
> I was sure the --size-only option should skip checking timestamps when
> finding candidates for update, but that was maybe wrong.
>
> Here is omething I found on the net:
> "
> Some "gotchas" in working with rsync under Windows
>
> 1. Include/Exclude file lists
> On windows, your --exclude-from or --include-from file must be in
> Unix format (newlines rather that cr/lf). Put a dos2ux line in your
> rsync script to ensure this.
>
>
> 2. Timestamps
> Windows doesn't keep file modification times to better than two
> seconds. Use the --modify-window=2 option to get around this.
>
>
> 3. Time zones
> rsync tries to convert all file timestamps into UTC at both ends.
> If seemingly identical files with the same timestamp seem to be
> transferring, try this at both ends:
> export TZ=UTC
> ls -l --full-time file_in_question
> If the remote and local files have the same timestamp, and they're
> still transferring, then you have a different problem. Otherwise, try
> --modify-window=3601 which means ignore time differences of less than an
> hour. This can be very helpful after a daylight savings time change.
> "
>
I put an -a in the command and then rsync went into archive mode. When I ran
it, rsync only replaced the changed files and the backup procedure went
rather fast. I ran the command once more and the backup was completed in a
few seconds.
Thanks for your help.
Dag
|