MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Auto restart MagicMirror after x hours ?

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    5 Posts 3 Posters 3.5k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      Smotx
      last edited by Smotx

      Hi everybody,

      After 5/6 hours my screen become black and i don’t find why.

      For view MM i do launch :

      pm2 restart mm
      

      So for auto restart after 5 hours, i have create a cron :

      * 5 * * * pm2 restart mm
      

      don’t work… :(

      but :

      pi@raspmagicmirror1:~/MagicMirror $ tail -f /var/log/syslog | grep CRON
      Sep 12 19:12:02 raspmagicmirror1 CRON[5590]: (root) CMD (pm2 restart mm)
      Sep 12 19:12:04 raspmagicmirror1 CRON[5586]: (CRON) info (No MTA installed, discarding output)
      

      So why MM don’t restart ?

      Thx for help (sorry for poor english)

      F 1 Reply Last reply Reply Quote 0
      • F Offline
        fuet @Smotx
        last edited by fuet

        @smotx, here is a thread with a similar goal to restart from cron:
        https://forum.magicmirror.builders/topic/6826/how-to-autorestart-mm-once-a-day/4

        1 Reply Last reply Reply Quote 0
        • M Offline
          MadScientist
          last edited by MadScientist

          My cronjob looks like this: 0 6 * * * pm2 reload mmand it is working just fine. Maybe try the reload instead of the restart command?
          Also, I run crontab -ewithout sudo.

          1 Reply Last reply Reply Quote 0
          • S Offline
            Smotx
            last edited by

            Thanks for help.

            I have installed gnome-schedule to manage from desktop mode with VNC.

            F 1 Reply Last reply Reply Quote 0
            • F Offline
              fuet @Smotx
              last edited by

              I see your original problem. You have the cron job set to execute each day at 5am.

              Here is the cron command for every five hours:
              0 */5 * * * pm2 restart /home/piMagicMirror/mm.sh

              I now have this running myself (every three hours).

              Note: The leading 0 means that it will execute in the 0th minute of the hour.

              1 Reply Last reply Reply Quote 0

              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
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy