Script de sauvegarde/restauration
This commit is contained in:
3
script/restauration/.my.cnf
Normal file
3
script/restauration/.my.cnf
Normal file
@@ -0,0 +1,3 @@
|
||||
[client]
|
||||
user=ap45
|
||||
password=Azerty1+
|
12672
script/restauration/bdarbre43.sql
Normal file
12672
script/restauration/bdarbre43.sql
Normal file
File diff suppressed because it is too large
Load Diff
12661
script/restauration/bdarbre45.sql
Normal file
12661
script/restauration/bdarbre45.sql
Normal file
File diff suppressed because it is too large
Load Diff
26
script/restauration/rest43
Executable file
26
script/restauration/rest43
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
HOST=root@onfarbo43
|
||||
restore () {
|
||||
ssh "${HOST}" "mysql -u ap45 -pAzerty1+ bdarbre" < bdarbre43.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 1 ;;
|
||||
*) printf " \033[31m %s \n\033[0m" "Entrée non valide"
|
||||
esac
|
||||
}
|
||||
confirm
|
||||
|
||||
exit 0
|
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