Skip to content
Snippets Groups Projects
Commit 8ef632ab authored by Elliott Shugerman's avatar Elliott Shugerman
Browse files

breaking change: if SCHEDULE is not set, run backup and then exit

parent 87d335f4
Branches master
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ pg_backup_s3:
POSTGRES_PASSWORD: password
```
- Images are tagged by the major PostgreSQL version they support: `9`, `10`, `11`, `12`, or `13`.
- The `SCHEDULE` variable determines backup frequency. See go-cron schedules documentation [here](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules).
- The `SCHEDULE` variable determines backup frequency. See go-cron schedules documentation [here](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules). Omit to run the backup immediately and then exit.
- If `PASSPHRASE` is provided, the backup will be encrypted using GPG.
- Run `docker exec <container name> sh backup.sh` to trigger a backup ad-hoc
......
......@@ -3,13 +3,11 @@
set -eu
if [ "$S3_S3V4" = "yes" ]; then
aws configure set default.s3.signature_version s3v4
aws configure set default.s3.signature_version s3v4
fi
if [ -z "$SCHEDULE" ]; then
# TODO: how to make CTRL-C work?
echo "WARNING: $SCHEDULE is null. Going to sleep."
tail -f /dev/null # do nothing forever
sh backup.sh
else
exec go-cron "$SCHEDULE" /bin/sh backup.sh
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment