Script de sauvegarde/restauration

This commit is contained in:
noeraphanaud
2022-02-09 10:33:18 +01:00
parent b85cfcdf7e
commit 78b1b1923d
18 changed files with 25526 additions and 0 deletions

26
script/restauration/rest45 Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
HOST=root@onfarbo45
restore () {
ssh "${HOST}" "mysql -u ap45 -pAzerty1+ bdarbre" < bdarbre45.sql
}
while getopts "f" OPT
do
case "${OPT}" in
f)
restore
exit 0;
;;
esac
done
confirm() {
read -r -n 1 -p "${1:-Confirmer?} [o/n]: " REPLY
case $REPLY in
[oO]) echo ; restore ;;
[nN]) echo ; exit 0 ;;
*) printf " \033[31m %s \n\033[0m" "Entrée non valide"
esac
}
confirm
exit 0