diff options
| author | sillylaird <sillylaird@fastmail.ca> | 2026-02-03 21:27:57 -0500 |
|---|---|---|
| committer | sillylaird <sillylaird@fastmail.ca> | 2026-02-03 21:27:57 -0500 |
| commit | 720d752748b793a2f5cf3cc14cb75ad86e8919c0 (patch) | |
| tree | 29120103307cb17e7d6c283cc198ec2484f934cd /tools/backup.sh | |
First commit
Diffstat (limited to 'tools/backup.sh')
| -rw-r--r-- | tools/backup.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/backup.sh b/tools/backup.sh new file mode 100644 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" |
