I've tried many things but cron just won't restart pm2.
I set the crontab -e
with:
SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin
*/10 * * * * /usr/bin/node /usr/bin/pm2 restart all
And the I type:
cat /var/log/cron.log
And it says:
Apr 2 01:00:01 fatsecret CRON[8202]: (peteblank) CMD (/usr/bin/node /usr/bin/pm2 restart all)
Apr 2 01:00:01 fatsecret CRON[8201]: (peteblank) MAIL (mailed 78 bytes of output but got status 0x004b from MTA#012)
Apr 2 01:10:01 fatsecret CRON[8454]: (peteblank) CMD (/usr/bin/node /usr/bin/pm2 restart all)
Apr 2 01:10:01 fatsecret CRON[8453]: (peteblank) MAIL (mailed 78 bytes of output but got status 0x004b from MTA#012)
So it looks like its restarting every 10 minutes, but its not.