Ctrl + C vs Ctrl + Z是否暂停回购同步?

时间:2018-07-21 15:39:36

标签: android bash git repository repo

使用下面的init命令后,我正在使用repo sync下载LineageOS 15.1。

repo init -u https://github.com/LineageOS/android.git -b lineage-15.1

由于我的互联网配额限制,我每天都需要暂停同步。如何实现?

我已经看到许多帖子告诉您使用:-

暂停/终止该工作
  • CTRL + Z,稍后再使用fg恢复它(前提是我不关机 我的电脑)
  • CTRL + C,然后再次使用repo sync,它应该通过略过.repo文件夹中已下载的文件(允许关机)从遗留的地方恢复。

但是它们似乎都不对用户有用(我还没有尝试)。因此,请让我知道哪个人可以实际工作或有最高的工作机会。

参考

  1. Pausing & Resume Android Repo Sync
  2. [TRICK] Pause the repo sync | Android Development and Hacking

1 个答案:

答案 0 :(得分:0)

我不得不尝试,所以我选择了 CTRL + C 选项,它实际上对我有用。

当我再次运行repo sync时,我可以看到它掠过已经获取的文件,并且在再次开始下载之前提到了 恢复传输 一词。因此,可以肯定地说,此选项可以有效地 暂停 repo sync使用。这是恢复部分浏览可用文件后的日志。

Fetching project platform/prebuilts/go/darwin-x86
Fetching project platform/external/piex5 MiB | 11.00 KiB/s     
Fetching project platform/external/libchrome
Fetching project device/generic/goldfish
Fetching project LineageOS/android_hardware_qcom_gps00 KiB/s   
Fetching projects:  22% (142/644)  Fetching project LineageOS/contributors-cloud-generator
remote: Sending approximately 67.13 MiB ...        .00 KiB/s   
remote: Counting objects: 474, done        
remote: Finding sources: 100% (17695/17695)           
Fetching project LineageOS/android_hardware_qcom_wlan
Fetching project platform/external/pdfium
** Resuming transfer from byte position 23711744
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Reremote: Counting objects: 7289, done        
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0Re  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0reremote: Finding sources: 100% (7289/7289)           00 KiB/s   
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0Re  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0Re  0     0    0     0    0     0      0      0 --:--:--  0:00:06 --:--:--     0ReFetching project platform/external/lz495.95 KiB | 32.00 KiB/s   

更新:除了 恢复转移 外,还显示 percentage Fetching projects: 22% (142/644)。这将从上次下载的百分比恢复。另外,顾名思义,repo sync将存储库同步到您的目录,没有理由重新启动它。毕竟,这仅仅是一个神话(回购同步不会从它的剩余位置恢复),这使像我这样的菜鸟感到困惑。

更新2:我还注意到,使用 CTRL + Z 暂停并恢复使用fg可能并不总是有效,并且可能导致网络中断以暂停同步。

相关问题