diff options
| author | sillylaird <sillyfanboy@gmail.com> | 2026-09-03 00:33:59 +0000 |
|---|---|---|
| committer | sillylaird <sillyfanboy@gmail.com> | 2026-09-03 00:33:59 +0000 |
| commit | 898b52edcb47bcb3e9d6106e74ca73e74ea01e70 (patch) | |
| tree | 85c6ee5ad58b860144551184d4cf86b560c62b91 /tools/backup.sh | |
| download | www-898b52edcb47bcb3e9d6106e74ca73e74ea01e70.tar.gz www-898b52edcb47bcb3e9d6106e74ca73e74ea01e70.zip | |
Diffstat (limited to '')
| -rwxr-xr-x | tools/backup.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/backup.sh b/tools/backup.sh new file mode 100755 index 0000000..36790bf --- /dev/null +++ b/tools/backup.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +BACKUP_DIR="${BACKUP_DIR:-/tmp/www.sillylaird.ca-backups}" + +mkdir -p "$BACKUP_DIR" +TS=$(date -u +"%Y%m%d-%H%M%S") +ARCHIVE="$BACKUP_DIR/www.sillylaird.ca-$TS.tar.gz" + +tar -czf "$ARCHIVE" -C "$ROOT_DIR" . + +echo "Backup written to $ARCHIVE" |
