remove usr
This commit is contained in:
parent
7e23294de4
commit
f6ab94e5f3
@ -15,12 +15,11 @@ backup() {
|
||||
opkg list-installed > packages-list.txt
|
||||
# 分别备份overlay、etc目录、和usr/share目录
|
||||
tar -czvf overlay_backup.tar.gz /overlay
|
||||
tar -czvf etc_backup.tar.gz --exclude='/etc/config/wireless' /etc
|
||||
tar -czvf usr_share_backup.tar.gz /usr/share
|
||||
tar -czvf etc_backup.tar.gz /etc
|
||||
# 将所有备份打包成一个文件
|
||||
tar -czvf backup.tar.gz distfeeds.conf packages-list.txt overlay_backup.tar.gz etc_backup.tar.gz usr_share_backup.tar.gz
|
||||
tar -czvf backup.tar.gz distfeeds.conf packages-list.txt overlay_backup.tar.gz etc_backup.tar.gz
|
||||
# 清理临时文件
|
||||
rm -rf distfeeds.conf packages-list.txt overlay_backup.tar.gz etc_backup.tar.gz usr_share_backup.tar.gz
|
||||
rm -rf distfeeds.conf packages-list.txt overlay_backup.tar.gz etc_backup.tar.gz
|
||||
green "系统备份文件已保存至 /tmp/upload/backup.tar.gz"
|
||||
light_magenta "请及时下载保存到电脑,恢复时使用系统——文件传输上传至/tmp/upload目录,再调用恢复脚本即可"
|
||||
}
|
||||
|
@ -18,10 +18,9 @@ restore() {
|
||||
# 恢复已安装软件列表
|
||||
opkg update
|
||||
cat packages-list.txt | cut -f 1 -d ' ' | xargs opkg install
|
||||
# 分别恢复overlay、etc目录、usr/share目录
|
||||
# 分别恢复overlay、etc目录
|
||||
tar -xzvf overlay_backup.tar.gz -C /
|
||||
tar -xzvf etc_backup.tar.gz -C /
|
||||
tar -xzvf usr_share_backup.tar.gz -C /
|
||||
green "恢复已完成, 系统正在重启....."
|
||||
reboot
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user