diff --git a/backup/backup.run b/backup/backup.run index 0d9b72c..941edae 100755 --- a/backup/backup.run +++ b/backup/backup.run @@ -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目录,再调用恢复脚本即可" } diff --git a/backup/restore.run b/backup/restore.run index 884509d..ae4f0c6 100755 --- a/backup/restore.run +++ b/backup/restore.run @@ -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