I'm trying to rsync a partial clone of mavencentral using rsync. The problem is, due to ridiculous network policies, I can only have the copy running during business hours. The process will be cut off before it has a chance to finish. When I run the same rsync command again, it will start from the top, looking for diff'd files, and never get to the end and actually start transferring files.

rsync -avP -e ssh user@server:/directory/for/maven .

It will start going through the tree no problem, but not transfer any files past the first attempt. It's just very slow to catch up to where it was. Any suggestions for resuming an rsync after it has closed?


You want the --update option, if you have very large files then also consider -partial.. family.

  • I have also tried with --update, to no benefit. – CB. Feb 10 '14 at 23:00
  • The option does work, but you are correct it first traverses the tree to work out what to do, before doing it. So if the tree is v large, you will waste a lot of time in this phase rather than transferring files. So my best suggestion is to step down a level and take smaller bites at it. – X Tian Feb 10 '14 at 23:30

rsync copies only files that have changed. That means if your first run was interrupted and you start over, then rsync reads the remote directory and compares the files on local machine by file size and creation date. So it does not start at the beginning. This comparison does not take long time and you have almost no network overhead.

If you want to compare the files also by its contents, then use -c.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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