ajout script

This commit is contained in:
Corentin 2022-11-23 14:12:59 +01:00
parent f1d0ad44fa
commit 80d67a50fb
2 changed files with 12 additions and 0 deletions

4
AP31/script_restore.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
# transfert de la base de donnée vers le serveur distant
zcat /root/sv/dump.latest.gz|ssh debian@ap31-test "mysql -u Adminer -pAdminer SDIS30"

8
AP31/script_sauvegarde.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
DAT=$(date "+%u")
# On compresse la base avec le filtre gzip
ssh ap31-test "mysqldump -u Adminer -pAdminer SDIS29|gzip" > /root/sv/SDIS29-dump-$DAT.sql.gz
# Permet d'obtenir la dernière sauvegarde
cp /root/sv/SDIS29-dump-$DAT.sql.gz /root/sv/dump-latest.sql.gz