diff --git a/entrypoint.sh b/entrypoint.sh index 4fafefa..6af0132 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,18 +19,17 @@ then push_start_notification="curl -s '$PUSH_URL_START' &&" fi - -if [ -n "$PUSH_URL_SUCCESS" ] -then - push_success_notification=" && grep -q 'backup finished' /tmp/backup.log && curl -s '$PUSH_URL_SUCCESS'" -fi - if [ -n "$PUSH_URL_FAIL" ] then push_fail_notification="|| curl -s '$PUSH_URL_FAIL'" fi -echo "$cron_schedule $push_start_notification backup --machine-logs create 2>&1 | tee /tmp/backup.log $push_success_notification $push_fail_notification" | crontab - +if [ -n "$PUSH_URL_SUCCESS" ] +then + push_notification=" && (grep -q 'backup finished' /tmp/backup.log && curl -s '$PUSH_URL_SUCCESS' $push_fail_notification)" +fi + +echo "$cron_schedule $push_start_notification backup --machine-logs create 2>&1 | tee /tmp/backup.log $push_notification" | crontab - crontab -l crond -f -d8 -L /dev/stdout