Change cron to execute as root

This commit is contained in:
Frederick Ding 2015-07-31 02:46:09 -04:00
parent 785f4c8d75
commit 4f7efa5a25
2 changed files with 5 additions and 4 deletions

View File

@ -45,7 +45,8 @@ if [ "$1" = 'cron' ] || [ "$1" = '/opt/save-attachments.sh' ]; then
fi fi
if [ "$1" = 'cron' ]; then if [ "$1" = 'cron' ]; then
exec /usr/sbin/cron && tail -f /var/mail/save-attachments.log /usr/sbin/cron && tail -f /var/mail/save-attachments.log
else exit $?
exec "$@"
fi fi
exec $@

View File

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