diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 18776c1..fec4353 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -1,8 +1,17 @@ #!/bin/sh -# Create crontab in a writable location +# Create crontab in a writable location and set proper permissions mkdir -p /tmp/crontabs -echo "${CRONTAB} /scripts/backup.sh" > /tmp/crontabs/root +echo "${CRONTAB:-"0 * * * *"} /scripts/backup.sh" > /tmp/crontabs/root +chmod 644 /tmp/crontabs/root +# Run initial backup /scripts/backup.sh -exec crond -f -c /tmp/crontabs + +# Start crond with debug output +echo "Starting crond with config:" +cat /tmp/crontabs/root +echo "---" + +# Start crond in foreground with debug output +exec crond -f -c /tmp/crontabs -d 8