Read the statement by Michael Teeuw here.
Schedule restart MagicMirror
-
“pm2 restart MagicMirror” in prompt works correctly but I can’t schedule it.
In crontab I write:
0 4 * * * pm2 restart MagicMirrorbut it doesn’t work
In system log there are:
magicmirror CRON[13707]: (root) CMD (pm2 restart MagicMirror) magicmirror CRON[17838]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
How can I schedule restart?
Thanks
-
@cldparisi Out of curiosity, what are you hoping to accomplish? I ask because MMM-Watchdog will quit the app (and if you have pm2 set to start MagicMirror automatically, it’ll get started once WatchDog kills the app). So, that might work for you?
-
@cldparisi u have to schedule as the user not root
-
Since the MM started automatically - I reboot the pi once at noon and shut it down completely in the evening.
The next morning it is woken up by the socket timer.crontab:
5 1,13 * * * sudo shutdown -r
0 22 * * * sudo shutdown -P now -
@sdetweil said in Schedule restart MagicMirror:
@cldparisi u have to schedule as the user not root
Yesss!!
Now I had edit crontab like pi instead root and It works!
Thanks
-
My crontab -e looks like this.
00 08 * * * pm2 restart mm
30 21 * * * pm2 stop allI have my background set to black and the desktop bar set to black, and the smallest icon size so when the pm2 stop all runs it looks like a blacked out screen with a few little bitty icons showing for walking around in the dark night light.
Then in the morning it restarts mm. This way it is not running the SSD or memory card all night adding to the read write times.