From 4f7efa5a253dce4a909228bfc3c86fd21df3ce69 Mon Sep 17 00:00:00 2001 From: Frederick Ding Date: Fri, 31 Jul 2015 02:46:09 -0400 Subject: [PATCH] Change cron to execute as root --- docker-entrypoint.sh | 7 ++++--- save-attachments.crontab | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 94e5b65..10f99b0 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -45,7 +45,8 @@ if [ "$1" = 'cron' ] || [ "$1" = '/opt/save-attachments.sh' ]; then fi if [ "$1" = 'cron' ]; then - exec /usr/sbin/cron && tail -f /var/mail/save-attachments.log -else - exec "$@" + /usr/sbin/cron && tail -f /var/mail/save-attachments.log + exit $? fi + +exec $@ diff --git a/save-attachments.crontab b/save-attachments.crontab index 983d13c..a2e22e0 100644 --- a/save-attachments.crontab +++ b/save-attachments.crontab @@ -1,2 +1,2 @@ -*/5 * * * * mail /opt/save-attachments.sh >> /var/mail/save-attachments.log 2>&1 +*/5 * * * * root /opt/save-attachments.sh >> /var/mail/save-attachments.log 2>&1