Fix docker logs output by creating the logfile first

This commit is contained in:
lobaro-demo
2017-01-18 10:39:52 +00:00
parent 531855c7ec
commit 9ba91cc61f

View File

@@ -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