Read the statement by Michael Teeuw here.
PM2 restart question (more of a linux question than MM)
-
@wyovino using the user’s crontab from when the job was defined is the most important
so
crontab -e
(no sudo)and then you would look in the /var/logs folder for the syslog file
and should find a logs entry for the CRON task execution
Mar 1 07:30:01 sams CRON[2992838]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi) Mar 1 07:30:01 sams CRON[2992839]: (sam) CMD (sshpass -f /home/sam/.idsync sudo rsync ....it might tell you what is happening to the prior cron jobs. (mine above is rsync just for demonstration)
pm2 might already have cron support
Using the --cron-restart Option This feature is used to ensure an application, which is intended to run continuously, is refreshed on a regular schedule. Command Line: bash pm2 start xxxx --cron-restart "0 0 * * *"pm2 save
-
-
Got it!
In the user crontab:
30 2 * * * /usr/local/bin/node /usr/local/bin/pm2 restart mm
Restarts the mirror every day at 2:30 am local time.
As always, thanks for your quick response!
Bill
-
Bill, I’m glad you found what you were looking for.
I’m curious - what issue are you addressing by restarting the MagicMirror daily?
I read this thread with interest because I too have thought about resorting to daily restarts on one of my mirrors. [I’ve figured out that daily restarts won’t meet my needs / fix my problem - so I haven’t gone down that road (yet). I guess I could design a cron schedule that staggers the restart enough that the photo display doesn’t show the same pictures every day, but not yet…]
-
@JohnGalt My mirror was sometimes stalling - falling to update even the clock.
-
@wyovino – Ok, good to know.
One of my magic mirrors stops every few days. There is only one module running on that mirror, MMM-BackgroundSlideshow, so it’s obvious when it happens.
-
@JohnGalt someone else has reported an out of memory w that module on discord
-
@sdetweil – Well, I’m not surprised. I have the pictures on a USB drive attached to the raspberry pi, and the more pictures on the drive the worse it gets. It does feel like the software is loading up memory with the pictures.
I tried some time ago pulling the pictures from a share on my NAS, (you had advised someone to do that on another thread) but I never got that to work.
Thanks for letting us know about the memory issue.
-
@JohnGalt what didn’t work? , glad to help if you want to try agsin
-
@sdetweil --Hi Sam
That was a while ago and my memory is foggy, but the issue was mapping a share on my NAS to the Raspberry Pi on which the MM is running…
As best I recall, I tried following directions to map the drive, but it didn’t work. I seem to recall being left with the sense that the process [a] had changed over time due to changes in distributions, and/or [b] that there was something left out of the directions that were likely too obvious to mention for someone who already knew, but was non-obvious to someone out of the know. At that point I gave up.
Fast forward to today - I’m happy to invest the time to learn and get it done if you’re willing to help!! I appreciate it. I sent you an email regarding how to best proceed.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login