I have the following .json configuration for a job that I need to run once every 10 minutes and then do nothing for the remaining time...
"name" : "test.10minjob",
"cron_restart": "*/10 * * * *",
"autorestart" : false,
"exec_mode" : "cluster",
"instances" : 1,
If I run it like this, it will run once and never restart.
If I run it with autorestart set to true, it will restart every time the job exits (i.e. is done).
Am I missing something obvious here?
js App in Development Mode with PM2. At this point, your server will auto-restart each time you create, modify or delete a source file in your project. It also works when you add or remove a dependency with npm or yarn .
Running Multiple PM2 If you want to run multiple PM2 under the same user, you can override the variable PM2_HOME . Setting the PM2_HOME will change the PM2 configuration folder, like communication sockets ( $HOME/. pm2/pub. sock and $HOME/.
Process name in the process list. string. Script filename without the extension (app for app.js) cwd. Current working directory to start the process with.
You could try this cron expression 0 0/10 * 1/1 * ? *
I created it using this tool:
http://www.cronmaker.com
The expression looks very different from yours and also if i put yours into a cron parser it complains about an invalid expression.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With