Skip to content

Instantly share code, notes, and snippets.

@blaise-io blaise-io/
Last active Jan 25, 2016

What would you like to do?
Debug cron job in minimal environment
# Sometimes cron jobs don't execute properly. It's hard to debug because
# the job may execute just fine if you run it manually in your shell.
# That's because cron jobs run in a minimal shell by default.
# This will run the script in a minimal environment:
env - /path/to/
# Spoiler alert: Usually, the solution is to define the shell in the script,
# by prepending #!/bin/bash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.