Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Using a cronjob I'm daily backing up a linux system (ubuntu) onto a windows network share so it gets picked up by our organisation's backup system.

Currently I'm copying using cp -au. Although this works ok to preserve as much filesystem information as possible I am thinking of compressing the files first to a tar or tar.gz archive before copying over. However I want to minimize the time it takes to copy the archive to the windows share - I only have a 60 minute time-window.

What is the best solution to copy only the minimal amount of data in this situation? As a subquestion would compressing the archive make it much harder to copy only changes?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

What is the best solution to copy only the minimal amount of data in this situation?

You can use rsync instead of cp.

rsync will only copy what has changed. Even when only a part of a file changes, rsync is smart enough to figure it out.

Its syntax similar to that of scp and it can preserve all meta information.

With rsync -z, data can also be compressed.

-z, --compress With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection.

Note that this option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection.

share|improve this answer
    
You need to setup an rsync server for it, right? –  KovBal Jul 23 '09 at 8:59
    
I found Deltacopy (aboutmyip.com/AboutMyXApp/DeltaCopy.jsp) which can be used on windows together with rsync on linux and seems pretty easy to setup. –  svandragt Jul 23 '09 at 9:04
    
Not necessarily, rsync can copy on a windows share like cp. It is almost a drop-in replacement for cp. You will have to look carefully at the options though. –  Ludwig Weinzierl Jul 23 '09 at 9:10
    
When I change a few files in the tgz archive will that make more differences for rsync throughout the archive than if I would change the same in only a tar archive (not compressed)? –  svandragt Jul 23 '09 at 9:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.