From dbb1228a082bae55c9e92f91d2b7c464192d7f3e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 10 Mar 2022 10:41:21 +0100 Subject: [PATCH] ajout dossier script avec svbase, restorenase et la crontab pour l'executer --- ap23/script/cron.txt | 1 + ap23/script/restorebase.sh | 2 ++ ap23/script/svbase.sh | 5 +++++ 3 files changed, 8 insertions(+) create mode 100644 ap23/script/cron.txt create mode 100755 ap23/script/restorebase.sh create mode 100755 ap23/script/svbase.sh diff --git a/ap23/script/cron.txt b/ap23/script/cron.txt new file mode 100644 index 0000000..f884ac1 --- /dev/null +++ b/ap23/script/cron.txt @@ -0,0 +1 @@ +0 21 * * 1-7 /root/svbase.sh diff --git a/ap23/script/restorebase.sh b/ap23/script/restorebase.sh new file mode 100755 index 0000000..d8353a3 --- /dev/null +++ b/ap23/script/restorebase.sh @@ -0,0 +1,2 @@ +#!/bin/bash +zcat latest.sql.gz | ssh root@ap23 "mysql -u gsbadm -pgsbadm gsbvisite" diff --git a/ap23/script/svbase.sh b/ap23/script/svbase.sh new file mode 100755 index 0000000..1e2d601 --- /dev/null +++ b/ap23/script/svbase.sh @@ -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