mirror of
https://github.com/lobaro/restic-backup-docker.git
synced 2026-04-26 04:49:25 +00:00
Fix docker logs output by creating the logfile first
This commit is contained in:
9
entry.sh
9
entry.sh
@@ -1,6 +1,7 @@
|
||||
#!bin/sh
|
||||
set -e
|
||||
|
||||
echo "Starting container ..."
|
||||
|
||||
if [ -n "${NFS_TARGET}" ]; then
|
||||
echo "Mounting NFS based on NFS_TARGET"
|
||||
@@ -15,6 +16,12 @@ fi
|
||||
echo "Setup backup cron job with cron expression: ${BACKUP_CRON}"
|
||||
echo "${BACKUP_CRON} /bin/backup >> /var/log/cron.log 2>&1" > /var/spool/cron/crontabs/root
|
||||
|
||||
# Make sure the file exists before we start tail
|
||||
touch /var/log/cron.log
|
||||
|
||||
# start the cron deamon
|
||||
crond
|
||||
tail -f /var/log/cron.log
|
||||
|
||||
echo "Container started."
|
||||
|
||||
tail -fn0 /var/log/cron.log
|
||||
|
||||
Reference in New Issue
Block a user