Skip to content

Instantly share code, notes, and snippets.

@gskielian
Created April 8, 2018 19:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gskielian/ff48e2fc0e06255dbce2b9688e09317b to your computer and use it in GitHub Desktop.
Save gskielian/ff48e2fc0e06255dbce2b9688e09317b to your computer and use it in GitHub Desktop.
Forever Start @reboot
#!/bin/bash
# usage, replace the <path to app.js file> with full path to your node app
# set crontab to @reboot <full path to this script>
# make sure to chmod +x this script to make it runnable
export PATH=/usr/local/bin:$PATH
if [ `/usr/local/bin/forever list | /usr/bin/wc -l` -le 1 ]; then
/usr/local/bin/forever start <path to app.js file>
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment