Pausing & Resume Android Repo Sync
Asked Answered
F

2

7

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

Fruition answered 23/9, 2012 at 20:7 Comment(6)
okay i tried syncing again using "repo sync" & then paused the operation using "ctrl+Z". Now i could resume using "fg" But still the question remains: "Does the sync start from where it was stopped"??Fruition
Can you give a link where the process of pausing sync process described?Joyless
(https://mcmap.net/q/1475350/-how-to-resume-repo-sync)Fruition
From this link I see that you cannot pause synchronization. You can just try to sync projects inside AOSP one by one.Joyless
okay.. from my experience from the last 4 days, i have come to a conclusion that the repo sync cannot be possibly paused. My sync hanged several times at different progress levels.. & then never recovered. i had to manually restart the sync. But this pushes the progress back to 33% & i have to start form this number everytime!! (Which is very very annoying!) Urghh.. BUT STANGELY THE DOWNLOADED FOLDER SIZE KEEPS ON INCREASING.. i wonder why?Fruition
Maybe 33% is when a big git project is downloaded (or several). After that another big project is not downloaded and repo sync starts from this 33%Joyless
D
24

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.

Downing answered 26/9, 2012 at 21:37 Comment(0)
C
1

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*'`
Corbett answered 26/9, 2018 at 7:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.