From d15bbe94677c9ce72a854fa507cfaae83cdcde73 Mon Sep 17 00:00:00 2001 From: 10 <2408212-10@users.noreply.gitlab.com> Date: Sat, 25 May 2019 23:02:29 +0200 Subject: [PATCH] Moved crond start out of condition fixes #7 --- entrypoint.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3aa14fd..7676ea4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh # vim: tabstop=2 shiftwidth=2 expandtab -#set -ux +#set -x BACKUP_CMD="/sbin/su-exec ${UID}:${GID} /app/backup.sh" @@ -15,7 +15,6 @@ fi if [ "$1" = "manual" ]; then $BACKUP_CMD fi -exit 0 # Initialize cron echo "Running as $(id)" @@ -23,11 +22,12 @@ if [ "$(id -u)" -eq 0 ] && [ "$(grep -c "$BACKUP_CMD" "$CRONFILE")" -eq 0 ]; the echo "Initalizing..." echo "$CRON_TIME $BACKUP_CMD >> $LOGFILE 2>&1" | crontab - - # Start crond if it's not running - pgrep crond > /dev/null 2>&1 - if [ $? -ne 0 ]; then - /usr/sbin/crond -L /app/log/cron.log - fi +fi + +# Start crond if it's not running +pgrep crond > /dev/null 2>&1 +if [ $? -ne 0 ]; then + /usr/sbin/crond -L /app/log/cron.log fi # Restart script as user "app:app"