Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Run command as cron
# env - run a program in a modified environment
# envirotnment is read from crontab file, usually it's below and nothing else:
# SHELL=/bin/sh
# PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
env - `cat /etc/crontab | grep -v "#" | grep -v "^$" | grep -v /etc/cron` my_script.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment