Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
execute cron job with flock
# my cronjob
* * * * * pahud /usr/bin/flock -w1 ${MP_UPD_LOCK} /usr/bin/python -c "from xxxx import foo as f; f.FooBar().update()" > /dev/null || SUBJ="[ERROR] flock on ${MP_UPD_LOCK} failed"; mail -s "${SUBJ}" "${MAILTO}" > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment