summaryrefslogtreecommitdiff
path: root/other/backup-site.sh
diff options
context:
space:
mode:
authorroot <root@vps-18a7a2b7.vps.ovh.ca>2023-04-13 18:49:04 -0400
committerroot <root@vps-18a7a2b7.vps.ovh.ca>2023-04-13 18:49:04 -0400
commitad0f80e4850bf0ba25db234e85b4d37c2c713150 (patch)
tree2942d37c704f3c054e0f797d654cb78df36f14d2 /other/backup-site.sh
parentd29e7f661ae2c8f761035e691b9b6d9f535b9e9d (diff)
other hosting stuff
Diffstat (limited to 'other/backup-site.sh')
-rwxr-xr-xother/backup-site.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/other/backup-site.sh b/other/backup-site.sh
new file mode 100755
index 0000000..4f4465a
--- /dev/null
+++ b/other/backup-site.sh
@@ -0,0 +1,17 @@
1#!/bin/sh
2hostname=$(hostname)
3r=0
4if LOGFILE=$(mktemp)
5then
6 exec 3>&2
7 exec 2>"$LOGFILE"
8fi
9set -x
10rsync -aRi --delete --partial /./srv/*/public_html rsync.net:"$hostname"/ >/dev/null || r=2
11mysqldump --all-databases | gzip -c | ssh rsync.net dd of="$hostname".sql || r=$((r+1))
12if [ "$r" != 0 ]
13then
14 cat "$LOGFILE" >&3
15fi
16rm -f "$LOGFILE"
17exit $r