ajout dossier script avec svbase, restorenase et la crontab pour l'executer

This commit is contained in:
root 2022-03-10 10:41:21 +01:00
parent ca2db9453f
commit dbb1228a08
3 changed files with 8 additions and 0 deletions

1
ap23/script/cron.txt Normal file
View File

@ -0,0 +1 @@
0 21 * * 1-7 /root/svbase.sh

2
ap23/script/restorebase.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
zcat latest.sql.gz | ssh root@ap23 "mysql -u gsbadm -pgsbadm gsbvisite"

5
ap23/script/svbase.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
DAT=$(date "+%u")
ssh root@ap23 "mysqldump -u gsbadm -pgsbadm gsbvisite | gzip" > gsbvisite-$DAT.sql.gz
cp gsbvisite-$DAT.sql.gz latest.sql.gz