#!/bin/sh mkdir /etc/cron.d touch /etc/cron.d/backup echo "$INTERVAL /bin/sh /app/backup.sh" > /etc/cron.d/backup # change ownership and make the cron known to crontab chmod 0644 /etc/cron.d/backup && crontab /etc/cron.d/backup if [ $RUNONSTART = 'true' ]; then echo $(date +"%Y-%m-%dT%T") "- Running initial backup" /bin/sh /app/backup.sh fi # Wait until infinity echo $(date +"%Y-%m-%dT%T") "- Starting cron" crond -f