Упрощен скрипт entrypoint.sh: изменен путь для crontab, улучшен вывод при запуске crond, добавлена обработка ошибок.
All checks were successful
docker-build / Build image (push) Successful in 1m59s
All checks were successful
docker-build / Build image (push) Successful in 1m59s
This commit is contained in:
@@ -1,17 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
set +e
|
||||
|
||||
# Create crontab in a writable location and set proper permissions
|
||||
mkdir -p /tmp/crontabs
|
||||
echo "${CRONTAB:-"0 * * * *"} /scripts/backup.sh >> /proc/1/fd/1 2>&1" > /tmp/crontabs/root
|
||||
chmod 644 /tmp/crontabs/root
|
||||
echo "${CRONTAB:-"0 * * * *"} /scripts/backup.sh >> /proc/1/fd/1 2>&1" > /etc/crontabs/root
|
||||
|
||||
# Run initial backup
|
||||
# /scripts/backup.sh
|
||||
|
||||
# Start crond with debug output
|
||||
echo "Starting crond with config:"
|
||||
cat /tmp/crontabs/root
|
||||
echo "---"
|
||||
/scripts/backup.sh
|
||||
|
||||
# Start crond in foreground with debug output
|
||||
exec crond -f -c /tmp/crontabs -d 8
|
||||
exec crond -f -d 0
|
||||
|
Reference in New Issue
Block a user