From 48eb1736aab9dcf98ab7dd766b32d40c9cbaef3d Mon Sep 17 00:00:00 2001 From: Elliott Shugerman Date: Thu, 28 May 2020 22:32:36 -0600 Subject: [PATCH] support null $SCHEDULE --- README.md | 1 - src/run.sh | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9b18bc..903bd73 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,5 @@ This project is a fork and re-structuring of schickling's [postgres-backup-s3](h - backup blobs and all schemas by default - drop and re-create all database objects on restore - some env vars renamed or removed - - `SCHEDULE` env var is required (but backups can still be triggered ad-hoc) - filter backups on S3 by database name diff --git a/src/run.sh b/src/run.sh index 51b8617..1571598 100644 --- a/src/run.sh +++ b/src/run.sh @@ -7,7 +7,9 @@ if [ "$S3_S3V4" = "yes" ]; then fi if [ -z "$SCHEDULE" ]; then - echo "You need to set the SCHEDULE environment variable." + # TODO: how to make CTRL-C work? + echo "WARNING: $SCHEDULE is null. Going to sleep." + tail -f /dev/null # do nothing forever else exec go-cron "$SCHEDULE" /bin/sh backup.sh fi