Read the statement by Michael Teeuw here.
pm2 doesnt work with crontab
- 
 @sdetweil Thanks. With sudo nano /etc/crontaband 30 16 * * * pi /home/pi/.config/nvm/versions/node/v10.23.0/bin/node /home/pi/.config/nvm/versions/node/v10.23.0/bin/pm2 stop mmit seems to work :) 
- 
 @keineahnung123 i don’t think u need those paths now 
- 
 45 16 * * * pi pm2 stop mmdoesnt work. I have to set the paths. I think there went something wrong when i upgraded to buster. 
 I had a shellscript withcd ~/MagicMirror && npm startwhich worked fine and after the upgrade to buster i have to use cd ~/MagicMirror && /home/pi/.config/nvm/versions/node/v10.23.0/bin/npm startotherwise it says “npm: not found” Same seems to be with crontab… 
- 
 @keineahnung123 looks like u need to reinstall nvm 
- 
 @sdetweil said in pm2 doesnt work with crontab: @keineahnung123 looks like u need to reinstall nvm nvm or npm? 
- 
 @keineahnung123 nvm 
- 
 @keineahnung123 
 Hello, i Can send you a script om monday, where you make backup to a small .img and where is restart you MagicMirror on the same time.
- 
 @Assassins 
 I would like to see this script. Please.
- 
 This is all I use in my crontab -e 
 15 07 * * * pm2 start mm
 30 21 * * * pm2 stop all
 Shuts MM down at 9:30 pm
 Starts MM backup at 7:15 am
 EVERYDAY.
 I have a Black background color and the bar at the bottom using black background which makes it look like the screen is off basically.
 That way it doesn’t flood the room with light at night.
 Also less read / writes to the ssd drive I use for my MM.
- 
 @sdetweil 
 My old crontab does not work in debian 12 aka bookworm
 Is there something i need to add to it to get it to work again?
 Really liked how it worked and the fact that I was getting a fresh restart of mm every morning…15 07 * * * pm2 start mm 30 21 * * * pm2 stop allTried this too. 15 07 * * * pi pm2 start mm 30 21 * * * pi pm2 stop all


