-
Notifications
You must be signed in to change notification settings - Fork 10
feat(docker): backup OpenSPP filestore (#66) #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 19.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -423,10 +423,18 @@ services: | |
| BACKUP_KEEP_DAYS: ${BACKUP_KEEP_DAYS:-7} | ||
| BACKUP_KEEP_WEEKS: ${BACKUP_KEEP_WEEKS:-4} | ||
| BACKUP_KEEP_MONTHS: ${BACKUP_KEEP_MONTHS:-6} | ||
| # Filestore backup (opt-in; see docker/README.md for sizing) | ||
| BACKUP_FILESTORE: ${BACKUP_FILESTORE:-false} | ||
| BACKUP_FILESTORE_COMPRESS: ${BACKUP_FILESTORE_COMPRESS:-false} | ||
| FILESTORE_SRC: ${FILESTORE_SRC:-/odoo_data/filestore/openspp} | ||
| BACKUP_FILESTORE_KEEP_DAYS: ${BACKUP_FILESTORE_KEEP_DAYS:-${BACKUP_KEEP_DAYS:-7}} | ||
| BACKUP_FILESTORE_KEEP_WEEKS: ${BACKUP_FILESTORE_KEEP_WEEKS:-${BACKUP_KEEP_WEEKS:-4}} | ||
| BACKUP_FILESTORE_KEEP_MONTHS: ${BACKUP_FILESTORE_KEEP_MONTHS:-${BACKUP_KEEP_MONTHS:-6}} | ||
| volumes: | ||
| - ./backup.sh:/backup.sh:ro,z | ||
| - ./backup-entrypoint.sh:/backup-entrypoint.sh:ro,z | ||
| - backup_data:/backups:rw,z | ||
| - odoo_data:/odoo_data:ro,z | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nothing here has been executed yet, including by CI. Both test-plan checkboxes are unticked and the note on #66 says the runtime test needs a production stack — so as far as I can tell this code has never run. CI hasn't covered the gap either: the head repo is Worth exercising this stack specifically rather than the Traefik one, because it's the more constrained of the two: |
||
| networks: | ||
| - openspp-prod | ||
| restart: unless-stopped | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -329,10 +329,18 @@ services: | |
| BACKUP_KEEP_DAYS: ${BACKUP_KEEP_DAYS:-7} | ||
| BACKUP_KEEP_WEEKS: ${BACKUP_KEEP_WEEKS:-4} | ||
| BACKUP_KEEP_MONTHS: ${BACKUP_KEEP_MONTHS:-6} | ||
| # Filestore backup (opt-in; see docker/README.md for sizing) | ||
| BACKUP_FILESTORE: ${BACKUP_FILESTORE:-false} | ||
| BACKUP_FILESTORE_COMPRESS: ${BACKUP_FILESTORE_COMPRESS:-false} | ||
| FILESTORE_SRC: ${FILESTORE_SRC:-/odoo_data/filestore/openspp} | ||
| BACKUP_FILESTORE_KEEP_DAYS: ${BACKUP_FILESTORE_KEEP_DAYS:-${BACKUP_KEEP_DAYS:-7}} | ||
| BACKUP_FILESTORE_KEEP_WEEKS: ${BACKUP_FILESTORE_KEEP_WEEKS:-${BACKUP_KEEP_WEEKS:-4}} | ||
| BACKUP_FILESTORE_KEEP_MONTHS: ${BACKUP_FILESTORE_KEEP_MONTHS:-${BACKUP_KEEP_MONTHS:-6}} | ||
| volumes: | ||
| - ./backup.sh:/backup.sh:ro | ||
| - ./backup-entrypoint.sh:/backup-entrypoint.sh:ro | ||
| - backup_data:/backups | ||
| - odoo_data:/odoo_data:ro | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new settings aren't reachable from configuration.
# Filestore backup (opt-in; see docker/README.md for sizing)
BACKUP_FILESTORE: ${BACKUP_FILESTORE:-false}
BACKUP_FILESTORE_KEEP_DAYS: ${BACKUP_FILESTORE_KEEP_DAYS:-${BACKUP_KEEP_DAYS:-7}}
BACKUP_FILESTORE_KEEP_WEEKS: ${BACKUP_FILESTORE_KEEP_WEEKS:-${BACKUP_KEEP_WEEKS:-4}}
BACKUP_FILESTORE_KEEP_MONTHS: ${BACKUP_FILESTORE_KEEP_MONTHS:-${BACKUP_KEEP_MONTHS:-6}}and give them a block in One trap to avoid: |
||
| networks: | ||
| - openspp-prod | ||
| restart: always | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No lock around the run.
backup.shhas noflock, so if a run outlasts the cron interval the next one starts on top of it. That was survivable when the script only ranpg_dump; once a multi-hour filestore tar is in the mix on a daily schedule, overlapping runs become realistic — and two concurrent tars writing the same.partname would corrupt each other.flockis in busybox, so this is cheap:Strictly a pre-existing gap that this change amplifies — fine to split into its own PR if you'd rather keep this one tight, but please don't drop it.