Skip to content

Instantly share code, notes, and snippets.

@cmprescott
Last active April 20, 2018 02:17
Show Gist options
  • Save cmprescott/05a674b50964900dcd29 to your computer and use it in GitHub Desktop.
Save cmprescott/05a674b50964900dcd29 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