Read the statement by Michael Teeuw here.
pm2 doesnt work with crontab
- 
 @plainbroke what userid did the pm2 jobs get created under? 
- 
 @sdetweil 
 pi is my user. I know not very original or safe but it is on a closed network.
 that is why I tried the pi user in the crontab.
 and it shows up when I do crontab -l.
 So I think it is setup under pi correctly.
 Do I need to do it as root sudo crontab -e and use pi or root as the user?
- 
 @plainbroke no. what fo the pm2 logs show? pm2 logs --lines=xxx 
 xxx is number of most recent lines, default 15
- 
 you can do cron restart with pm2 too, see https://pm2.keymetrics.io/docs/usage/restart-strategies/ 
- 
 This post is deleted!
- 
 @plainbroke i mean after cron trying to start 
 pm2set a cron entry for an hour from now stop MagicMirror and flush the logs pm2 stop all 
 pm2 flushsee what the logs say then 
- 
 @karsten13 yes, but he wants stop and start 
- 
 
- 
 @plainbroke how long til it might trigger? 
- 
 @sdetweil 
 From that post about an hour. and it was supposed to trigger this morning around 6:30 am.
 It did not and it did not leave anything in the logs since last night when I pm2 stop all then pm2 flush. around 8:30 pm .
 So that means cron job did nothing with pm2 over night
 I have been experimenting so there are a couple different job lines.
 I really expected something in the log. But this is all I get.pi@MM:~ $ pm2 logs --lines=100 [TAILING] Tailing last 100 lines for [all] processes (change the value with --lines option) /home/pi/.pm2/pm2.log last 100 lines: /home/pi/.pm2/logs/mm-out.log last 100 lines: /home/pi/.pm2/logs/mm-error.log last 100 lines:My Crontab on 2 different MM setups. I get the same nothing on both. 
 Both are running Bookworm and MM 2.3.105 20 * * * pi /usr/local/bin/pm2 start mm 15 07 * * * pi pm2 start mm 30 21 * * * pi pm2 stop mm 05 20 * * * root /usr/local/bin/pm2 start mm 15 07 * * * root pm2 start mm 30 21 * * * root pm2 stop mm


