I am using PM2 to keep Ghost (blogging platform) alive and I need a Cron Job to restart Ghost in the event of a server reboot. However, I am unsure of the proper code for the Cron Job.
I read that this is what I am to use:
@reboot /usr/local/bin/npm start /path/to/ghost/
but instead of using npm start
should I replace it with pm2 start index.js
which is what I use to start Ghost with PM2?
Note: I do not have root access and I cannot use pm2 startup
. This is why I am using a Cron Job. Also this area is new to me; please provide examples.