#!/bin/bash
src=/server/system_backup/
dst=/
backup () {
rsync -av --exclude={"/proc","/sys","/run","/server"} $dst $src
}
recovery () {
rsync -av --delete --exclude={"/proc","/sys","/run","/server"} $src $dst
}
case $1 in
backup)
backup
;;
recovery)
recovery
;;
*)
echo "Usage: {backup|recovery}"
esac
~
运行 tools.sh backup 备份系统目录
tools.sh recovery 恢复系统目录
时间: 2024-10-15 14:32:37