pm2
pm2 copied to clipboard
pm2 start (at time)
Hello. This is my situation.
pm2 start node --name sessioni_approvate -- /root/nodejs_sessioneapprovate/sessioni_approvate.js --cron "0 20 8 * * 1,2,3,4,5,6"
i need to reload this "js" app every day expect sunday at 8:20 am. the app performs a series of checks, writes some things and then the browser closes waiting for the new execution.
However, if I restarted the machine, to be able to start the app again, I have to issue that command.
I don't want that when I give that command, the app runs and then waits for the cron event. I would like to issue the command but the first execution must be at the cron event. It's possible?
The cron argument is only for restart strategies and not for starting strategies so this will not work.
My suggestion is to use the OS's cron to schedule the launch of your script.
I'm going through the issues to find mentions about not auto-starting a new process, which I now created a PR for: #5780