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