Skip to content

Instantly share code, notes, and snippets.

@KyonLi
Forked from cmprescott/S10cron
Created April 20, 2018 02:16
Show Gist options
  • Save KyonLi/ff4d4acb1b5bf22c2ef2444c95c56de2 to your computer and use it in GitHub Desktop.
Save KyonLi/ff4d4acb1b5bf22c2ef2444c95c56de2 to your computer and use it in GitHub Desktop.
optware cron startup script that also sets correct file permissions
#!/bin/sh
#
# Startup script for optware cron
#
# Fix file permissions
# Cron throws an error if these files are anything other than RW by owner
chmod 600 /opt/etc/crontab
chmod -R 600 /opt/etc/cron.d/
# Stop myself if running
PIDFILE=/opt/var/run/cron.pid
[ -f ${PIDFILE} ] && kill `cat ${PIDFILE}`
/opt/sbin/cron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment