• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.1k 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 Sep 12, 2018, 6:29 PM Sep 12, 2018, 5:21 PM

    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 Sep 13, 2018, 12:05 PM Reply Quote 0
    • F Offline
      fuet @Smotx
      last edited by fuet Sep 13, 2018, 12:06 PM Sep 13, 2018, 12:05 PM

      @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 Sep 13, 2018, 12:12 PM Sep 13, 2018, 12:11 PM

        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 Sep 13, 2018, 4:56 PM

          Thanks for help.

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

          F 1 Reply Last reply Sep 14, 2018, 2:00 AM Reply Quote 0
          • F Offline
            fuet @Smotx
            last edited by Sep 14, 2018, 2:00 AM

            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
            • 1 / 1
            1 / 1
            • First post
              3/5
              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