Repository navigation
Backups: make docker compose exec runs work; name logs by service - #40
Merged
Merged
Conversation
`docker logs backup` fails: Compose names the container gam-backup-1. `docker compose logs backup` takes the service name and works however Compose names things. Same slip for the archive's backend container. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XWoa1a1upTria7ntq56x3B
…tory The README's way to start a first backup by hand, `docker compose exec backup backup.sh`, failed with "Please specify repository location": exec starts a fresh process with only the container's configured environment, so the RESTIC_REPOSITORY and RCLONE_CONFIG_NAS_* exports made in the entrypoint never reached it. Cron runs inherit them and were unaffected. Those exports move to env.sh, sourced by the entrypoint and by backup.sh itself, so every way of starting a run gets them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XWoa1a1upTria7ntq56x3B
docker compose exec runs work; name logs by service
davior
marked this pull request as ready for review
October 22, 2026 03:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Two failures hit while following the backup guide on the server:
Fatal: Please specify repository locationwhen starting the first backup withdocker compose exec -d backup sh -c '/usr/local/bin/backup.sh …', the guide's own instruction.execstarts a fresh process with only the container's configured environment, so theRESTIC_REPOSITORYandRCLONE_CONFIG_NAS_*exports made inentrypoint.shnever reached it. Scheduled runs inherit those exports from crond and were unaffected.No such container: backupfromdocker logs -f backup. Compose names the containergam-backup-1;backupis only the service name.Changes
ops/backup/env.sh, installed as/usr/local/lib/backup-env.sh. It holds the derived exports (the restic repository and the rclonenasremote), and bothentrypoint.shandbackup.shsource it. Every way of starting a run now gets the same settings. The SSH config is still written by the entrypoint; it's a file, soexecalready saw it.docker logs [-f] backupis nowdocker compose logs [-f] backup, anddocker inspectnamesgam-backup-1. The archive's backend container in Container Manager isgam-archive-backend-1.Testing
env -i),main'sbackup.shhands resticRESTIC_REPOSITORY=UNSET.sftp:synology-backup:/GeckoNotes/gam/resticand rclone getstype=sftp host=…. The full run, mirror included, completes against a local remote.sh -npasses on all three scripts.🤖 Generated with Claude Code
https://claude.ai/code/session_01XWoa1a1upTria7ntq56x3B