Skip to content

Instantly share code, notes, and snippets.

@kirankotari
Created August 4, 2022 09:23
Show Gist options
  • Save kirankotari/8bf0e8f11606ccbe1d27810caf0ac2f7 to your computer and use it in GitHub Desktop.
Save kirankotari/8bf0e8f11606ccbe1d27810caf0ac2f7 to your computer and use it in GitHub Desktop.
cronjob running a shell script from it
  1. Need to change relative paths to absolute paths
  2. Need to replace /bin/bash to absolute reference ie. /usr/bin/bash
  3. In the crontab -e need to add following PATH to run a script
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  4. Add the PATH at the top of the shell script
  5. Now set the timer, we should be good to go.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment