Pausing & Resume Android Repo Sync

Chinmay Jade picture Chinmay Jade · Sep 23, 2012 · Viewed 16.3k times · Source

I am trying to sync the following repo

repo init -u git://github.com/SlimRoms/platform_manifest.git -b jb

The problem is i have started the repo sync around 30 hours ago & its still not complete. (i have a 1Mbps connection). I dont want to keep the laptop switched for so long now & would like to pause the current sync & resume later.

So, i searched a bit, and found out that to pause the current download/sync i could use:

  • ctrl+C
  • ctrl+Z
  • just close the terminal (it will resume download next time automatically)

So i tried using ctrl+c, the download stopped. And then to resume i tried "fg", but it doesnt start again. The error i get is:

bash: fg: current: no such job

Can anybody help me out here? Can i just shut down & continue the sync later using:?

repo sync

Answer

Paul picture Paul · Sep 26, 2012

You can't really pause a repo sync, but if you abort it using Ctrl-C and then run it again later, it will effectively pick up where it left off. Although it will start working through the project list from the beginning again, and may still fetch some new data for projects that have already been processed, it should whizz through these projects, because all of the data that it had previously fetched will still be there in the hidden .repo directory.

See this answer for an excellent description of the way that repo init and repo sync work.

Note that you won't immediately see any of the projects that have been fetched, because repo sync doesn't create and populate your working directories until it has finished cloning all of the git repositories in .repo/projects.