Read the statement by Michael Teeuw here.
pm2 doesnt work with crontab
-
@chrisfr1976 said in pm2 doesnt work with crontab:
find / -iname pm2
/usr/local/bin/pm2 /usr/local/lib/node_modules/pm2 /usr/local/lib/node_modules/pm2/bin/pm2 /usr/local/lib/node_modules/pm2/lib/templates/logrotate.d/pm2 /usr/local/lib/node_modules/pm2/pm2 /home/pi/MagicMirror/node_modules/.bin/pm2 /home/pi/MagicMirror/node_modules/pm2 /home/pi/MagicMirror/node_modules/pm2/bin/pm2 /home/pi/MagicMirror/node_modules/pm2/lib/templates/logrotate.d/pm2 /home/pi/MagicMirror/node_modules/pm2/pm2Which is the true one and one to use?
-
@plainbroke
Then use this:
/usr/local/bin/pm2 -
@chrisfr1976
@sdetweil
Thank you both for the help.
/usr/local/bin/pm2 restart mm
worked so I set it up to stop now and if (fingers crossed) works.
I am golden.
Wonder why I never had to use the full path before?
Maybe my pm2 path was /home/pi/pm2 before.
Doesn’t really matter as long as it works, I am a happy camper.
It works.
Thank you so much… I will mark this solved.
Well I would if I could… strange.By the way " which pm2 " shows the path that I needed to use in crontab -e
-
@plainbroke awesome
i should have remembered the path problem
-
@sdetweil
Did the new MM and or trixie change the way crontab works? Mine has stopped working since the update to 2.33. I tried again tonight and will see if the changes work or not… also my mm.json file quit working. Hind sight is 20/20 should have left well enough alone… -
@plainbroke I do not know
Sorry, I have to ask, you DID use a new sd card, right?
What does /var/log/syslog say about the crontab execution
Did you use crontab -e
Or sudo crontab -e1st is run as user who executed the crontab command
2nd is run as root -
@sdetweil
Using NVMe disk 256gb smallest I had on hand. 3 of them are exhibiting the same issues. I did try going back to Bookworm and I am still getthing a blank screen after a while. I ran npm run config:check it says all is good in the config.js ////
I am currently reloading from scratch.
Which OS is better for the 2.33 MM? 32 or 64 bit?
Wondering if I was using 32 bit and now the 64 bit is messing with me… So dang many things can mess with these little devices.I only use crontab -e, should I try sudo crontab -e
-
@plainbroke no, without sudo is best
Maybe pm2 isn’t in the path when crontab fires
Check the syslog for crontab errors32 bit is about to be trouble.
The latest nodejs version, 24, has dropped builds for 32 bit
-
@sdetweil
Thanks for the info I almost pulled down 32 bit.
It has been interesting to say the least going to trixie.
Turns out my problem was a failed NVMe drive.
I thought those things where supposed to last for a LONG long time…
I did get crontab -e to work with trixie and MM 2.33 not a fun ride, but entertaining. I finally learned how to use bash to make batch style files…
So not a complete loss of time… -
@plainbroke technology is SOOOO much fun! Simple, til it’s not!
Thanks for the feedback. Others will ask, I’m sure they could use your help!
