Changeset d2b7247 in Klonkt for deploy/backup.sh
- Timestamp:
- 06/27/2026 09:53:29 PM (2 months ago)
- Branches:
- main
- Children:
- 907a013
- Parents:
- abdcf33
- File:
-
- 1 edited
-
deploy/backup.sh (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
deploy/backup.sh
rabdcf33 rd2b7247 1 1 #!/usr/bin/env bash 2 2 # 3 # PrutCMS v10— nightly backup script.3 # Klonkt — nightly backup script. 4 4 # 5 5 # Snapshots: … … 13 13 # 14 14 # Recommended cron: 15 # 0 3 * * * /home/robin/ prutcms/deploy/backup.sh >> /home/robin/prutcms/logs/backup.log 2>&115 # 0 3 * * * /home/robin/klonkt/deploy/backup.sh >> /home/robin/klonkt/logs/backup.log 2>&1 16 16 17 17 set -euo pipefail 18 18 19 19 # ── Config ──────────────────────────────────────────────────────── 20 APP_DIR="${APP_DIR:-/home/robin/ prutcms}"21 BACKUP_DIR="${BACKUP_DIR:-/home/robin/backups/ prutcms}"20 APP_DIR="${APP_DIR:-/home/robin/klonkt}" 21 BACKUP_DIR="${BACKUP_DIR:-/home/robin/backups/klonkt}" 22 22 KEEP_DAYS="${KEEP_DAYS:-14}" 23 23 TS="$(date +%Y%m%d-%H%M%S)" … … 35 35 36 36 # ── Tar the snapshot + storage subdirs ──────────────────────────── 37 ARCHIVE="$BACKUP_DIR/ prutcms-$TS.tar.gz"37 ARCHIVE="$BACKUP_DIR/klonkt-$TS.tar.gz" 38 38 tar -czf "$ARCHIVE" \ 39 39 -C "$BACKUP_DIR" "$(basename "$DB_SNAPSHOT")" \ … … 47 47 48 48 # ── Rotation ─────────────────────────────────────────────────────── 49 find "$BACKUP_DIR" -type f -name ' prutcms-*.tar.gz' -mtime "+$KEEP_DAYS" -delete49 find "$BACKUP_DIR" -type f -name 'klonkt-*.tar.gz' -mtime "+$KEEP_DAYS" -delete 50 50 51 51 SIZE="$(du -h "$ARCHIVE" | cut -f1)"
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)