树莓派一键备份脚本 备份为img镜像 可用于量产 可选备份位置 适配Debian/Ubuntu
2019-02-24 by 崔斐然
2019-02-28補充:
鑒于備份過程可能花費大量時間,建議使用ssh操作的同學安裝screen管理會話,避免因網絡波動造成ssh掉線任務失敗。參考我的另一篇博文: 樹莓派安裝screen保證SSH斷開 任務不中斷
? README IN English
樹莓派備份腳本
一個幫助我們備份樹莓派系統的小腳本,適配Ubuntu/Debian
GitHub:https://github.com/cuifeiran/pi_backup
測試
- 2019-02-21 Debian9 Stretch 備份至 NTFS u盤 通過
如果你在使用腳本中成功備份或者失敗,請在issues中提出來,方便改進,謝謝
使用方法
git clone https://github.com/cuifeiran/pi_bakup.git cd pi_bakupsh bak.sh然后請選擇備份情況,1:從SD卡備份到u盤(默認為第一個u盤:/dev/sda1)2:從u盤啟動的備份到另一張u盤(默認為第二個u盤:/dev/sda2)
其他需求請自行修改代碼
注意
由于備份時間過長,若使用SSH,其默認超時配置項可能導致備份中斷,建議修改ssh默認超時時間或者安裝screen,參考:崔斐然的CSDN screen不掉線 或者崔斐然的CSDN ssh配置
備份過程一般需要20分鐘以上,執行到part1時不會顯示進度,請耐心等待。
改動
2019-02-21 改動:新增part1創建映像顯示進度
2019-02-21 改動:創建的映像大小從1.3
參考:
conanwhf/RaspberryPi-script
- 感謝前輩付出!(沒有forked的原因是這個腳本可能被我改糟,不想污染master所以新建了一個倉。)
RASPBERRY_BACKUP
help us to backup our piSD or piUSB to UsbSrotage Adaptation Ubuntu/Debian https://github.com/cuifeiran/pi_backup
TEST
- 2019-02-21 Debian9 Stretch backup to NTFS usb storage pass
If you have any trouble with backup success or failure, please submit result in Issues to help me improve script. Thanks.
HOW TO USE IT
git clone https://github.com/cuifeiran/pi_bakup.git cp pi_bakup sh bak.shAnd then,choose1:backup piSD>first USB storage(Default :/dev/sda1). if your pi system in USB storage,choose2:backup piUSB >second USB storage(Default:/dev/sda2)
other demand please revise the code by yourself
NOTES
Because backup time is too long, if SSH is used, its default timeout configuration item may cause backup interruption. It is recommended to modify the default timeout time of SSH or install screen.Reference resources: CSDNDave’s CSDN screen_noOffline orDave’s CSDN ssh_config
The backup process usually takes more than 20 minutes. The progress will not be displayed when the backup process is executed to part1. Please wait patiently.
UPDATE
2019-02-21 update:part1 createing img shows progress
2019-02-21 change:create img size 1.3 multiple to 1.5 multiple
REFERENCE RESOURCES:
conanwhf/RaspberryPi-script
- Thank your predecessors for giving! (The reason why there is no forked is that the script may have been worsened by me. I didn’t want to pollute the master, so I built a new warehouse. )
總結
以上是生活随笔為你收集整理的树莓派一键备份脚本 备份为img镜像 可用于量产 可选备份位置 适配Debian/Ubuntu的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 基于机器学习的捡球机器人设计与实现(探索
- 下一篇: python 利用pyttsx3文字转语