From 00c717686b9aeb2e9f9688e2bc32b551bde3f00d Mon Sep 17 00:00:00 2001 From: Louis Depres Date: Thu, 10 Mar 2022 10:24:27 +0100 Subject: [PATCH] Serveur Sv --- sv/cron.txt | 1 + sv/restorebase | 2 ++ sv/svbase | 5 +++++ 3 files changed, 8 insertions(+) create mode 100644 sv/cron.txt create mode 100755 sv/restorebase create mode 100755 sv/svbase diff --git a/sv/cron.txt b/sv/cron.txt new file mode 100644 index 0000000..a24ab04 --- /dev/null +++ b/sv/cron.txt @@ -0,0 +1 @@ +0 21 * * 1-7 /root/svbase diff --git a/sv/restorebase b/sv/restorebase new file mode 100755 index 0000000..88fba5a --- /dev/null +++ b/sv/restorebase @@ -0,0 +1,2 @@ +#!/bin/bash +zcat latest.sql.gz|ssh root@ap22 "mysql -u gsbadm -pgsbadm gsbvisite" diff --git a/sv/svbase b/sv/svbase new file mode 100755 index 0000000..191a54a --- /dev/null +++ b/sv/svbase @@ -0,0 +1,5 @@ +#!/bin/bash +DAT=$(date "+%u") + +ssh root@ap22 "mysqldump -u gsbadm -pgsbadm gsbvisite | gzip" > gsbvisite-$DAT.sql.gz +cp gsbvisite-$DAT.sql.gz latest.sql.gz