Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pausing & Resume Android Repo Sync

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

like image 833
Chinmay Jade Avatar asked Sep 23 '12 20:09

Chinmay Jade


People also ask

What is this word pausing?

to cease an action temporarily; stop. to hesitate; delayshe replied without pausing. noun. a temporary stop or rest, esp in speech or action; short break. prosody another word for caesura.

What means pausing for a moment?

to stop doing something for a short time, or to make something stop for a short time: He paused and thought for a moment.

What is Pause example?

To pause is defined as to stop for a brief period of time. An example of pause is to stop a movie for a couple of minutes. verb. 5.

What are pauses in speech called?

A speech disfluency, also spelled speech dysfluency, is any of various breaks, irregularities, or non-lexical vocables which occur within the flow of otherwise fluent speech.


2 Answers

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.

like image 166
Paul Avatar answered Oct 04 '22 16:10

Paul


If you want to repo sync without hanging up, you can use:

nohup repo sync &

and exit the ssh/telnet/terminal session.

For the disk space increasing issue, just do the following periodically:

cd /path/to/repo
rm -f `find . -name '*tmp_pack*'`
like image 27
carltao Avatar answered Oct 04 '22 18:10

carltao