MAJ script sauvegarde
This commit is contained in:
parent
ae9a7e9be9
commit
2025b1ab3c
13
restorebase
13
restorebase
@ -1,4 +1,13 @@
|
||||
#!/bin/bash
|
||||
DAT=$(date "+%u")
|
||||
scp /root/sauvegarde/gsbvisite-$DAT.sql.gz root@ppe21:/root
|
||||
|
||||
bdname="bdgsb2"
|
||||
ssh root@ppe21 'echo "use bdgsb2;"|mysql -u admin -padmin'
|
||||
if [[ $? != 0 ]]; then
|
||||
ssh root@ppe21 'echo "create database bdgsb2;"|mysql -u admin -padmin'
|
||||
fi
|
||||
if ! [[ -r gsbvisite-latest.sql.gz ]]; then
|
||||
echo "$0 : fichier gsbvisite-latest introuvable"
|
||||
exit 1
|
||||
fi
|
||||
zcat gsbvisite-latest.sql.gz | ssh root@ppe21 "mysql -u admin -padmin bdgsb2"
|
||||
exit 0
|
||||
|
3
svbase
3
svbase
@ -1,4 +1,5 @@
|
||||
#!/bin/bash
|
||||
DAT=$(date "+%u")
|
||||
ssh root@ppe21 "mysqldump -u admin -padmin bdgsb | gzip" > /root/sauvegarde/gsbvisite-$DAT.sql.gz
|
||||
ssh root@ppe21 "mysqldump -u admin -padmin bdgsb | gzip" > /root/sauvegarde/gsbvisite-${DAT}.sql.gz
|
||||
cp /root/sauvegarde/gsbvisite-${DAT}.sql.gz /root/sauvegarde/gsbvisite-latest.sql.gz
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user