4

备份你的Linux系统

 2 years ago
source link: https://allenwind.github.io/blog/11637/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Mr.Feng Blog

NLP、深度学习、机器学习、Python、Go

备份你的Linux系统

使用脚本备份Linux系统,这里给出参看脚本。

备份脚本,

tar cvpzf /home/allenwind/desktop/packup/ubuntu.tgz \
--exclude=/proc \
--exclude=/var/lib/docker \
--exclude=/snap \
--exclude=/swapfile \
--exclude=/mnt \
--exclude=/cdrom \
--exclude=/lost+found \
--exclude=/sys \
--exclude=/var \
--exclude=/media \
--exclude=/run \
--exclude=/tmp \
--exclude=/home/allenwind/software \
--exclude=/home/allenwind/download \
--exclude=/home/allenwind/desktop /

恢复系统,

tar xvpfz ubuntu.tgz -C /
sudo update-grub

不过需要注意,如果硬件设备尤其是磁盘发生改变,可能无法顺利恢复系统,需要grub重构引导。

[1] https://help.ubuntu.com/community/BackupYourSystem/TAR

转载请包括本文地址:https://allenwind.github.io/blog/11637/
更多文章请参考:https://allenwind.github.io/blog/archives/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK