Script de sauvegarde/restauration
This commit is contained in:
26
script/restauration/rest45
Executable file
26
script/restauration/rest45
Executable 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
|
Reference in New Issue
Block a user