chore: updated apps/backup to support posts 63dba518
Steve · 2026-04-07 20:02 4 file(s) · +11 −3
apps/backup/.env.example +1 −0
9 9
# JOTTS_VOLUME=jotts_jotts-data
10 10
# SIPP_VOLUME=sipp_sipp-data
11 11
# CELLAR_VOLUME=cellar_cellar-data
12 +
# POSTS_VOLUME=posts_posts-data
12 13
13 14
# Optional: days to keep backups (default: 30)
14 15
# RETENTION_DAYS=30
apps/backup/README.md +4 −1
1 1
# Backup
2 2
3 -
Automated SQLite backups for Jotts, Sipp, and Cellar to Cloudflare R2. Runs every 6 hours via cron inside a Docker container and prunes backups older than 30 days.
3 +
Automated SQLite backups for Jotts, Sipp, Cellar, and Posts to Cloudflare R2. Runs every 6 hours via cron inside a Docker container and prunes backups older than 30 days.
4 4
5 5
## Setup
6 6
44 44
JOTTS_VOLUME=jotts_jotts-data
45 45
SIPP_VOLUME=sipp_sipp-data
46 46
CELLAR_VOLUME=cellar_cellar-data
47 +
POSTS_VOLUME=posts_posts-data
47 48
```
48 49
49 50
Run `docker volume ls` to check the actual names on your host.
81 82
  -v jotts_jotts-data:/data/jotts:ro \
82 83
  -v sipp_sipp-data:/data/sipp:ro \
83 84
  -v cellar_cellar-data:/data/cellar:ro \
85 +
  -v posts_posts-data:/data/posts:ro \
84 86
  ghcr.io/stevedylandev/andromeda-backup:latest
85 87
```
86 88
148 150
| `JOTTS_VOLUME` | `jotts_jotts-data` | Docker volume name for Jotts data |
149 151
| `SIPP_VOLUME` | `sipp_sipp-data` | Docker volume name for Sipp data |
150 152
| `CELLAR_VOLUME` | `cellar_cellar-data` | Docker volume name for Cellar data |
153 +
| `POSTS_VOLUME` | `posts_posts-data` | Docker volume name for Posts data |
apps/backup/backup.sh +2 −2
5 5
BUCKET="${R2_BUCKET:-andromeda-backups}"
6 6
RETENTION_DAYS="${RETENTION_DAYS:-30}"
7 7
8 -
DBS="jotts:/data/jotts/jotts.sqlite sipp:/data/sipp/sipp.sqlite cellar:/data/cellar/cellar.sqlite"
8 +
DBS="jotts:/data/jotts/jotts.sqlite sipp:/data/sipp/sipp.sqlite cellar:/data/cellar/cellar.sqlite posts:/data/posts/posts.sqlite"
9 9
10 10
for entry in $DBS; do
11 11
  name="${entry%%:*}"
28 28
29 29
# Prune old backups
30 30
cutoff=$(date -u -d "-${RETENTION_DAYS} days" +%Y-%m-%d 2>/dev/null || date -u -v-${RETENTION_DAYS}d +%Y-%m-%d)
31 -
for name in jotts sipp cellar; do
31 +
for name in jotts sipp cellar posts; do
32 32
  aws s3 ls "s3://${BUCKET}/${name}/" --endpoint-url "${R2_ENDPOINT}" 2>/dev/null | while read -r line; do
33 33
    filedate=$(echo "$line" | awk '{print $1}')
34 34
    filename=$(echo "$line" | awk '{print $4}')
apps/backup/docker-compose.yml +4 −0
5 5
      - jotts-data:/data/jotts:ro
6 6
      - sipp-data:/data/sipp:ro
7 7
      - cellar-data:/data/cellar:ro
8 +
      - posts-data:/data/posts:ro
8 9
    env_file: .env
9 10
    restart: unless-stopped
10 11
18 19
  cellar-data:
19 20
    external: true
20 21
    name: ${CELLAR_VOLUME:-cellar_cellar-data}
22 +
  posts-data:
23 +
    external: true
24 +
    name: ${POSTS_VOLUME:-posts_posts-data}