MagicMirror² v2.14.0 is available! For more information about this release, check out this topic.

Auto restart MagicMirror after x hours ?

  • 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)

  • @smotx, here is a thread with a similar goal to restart from cron:

  • 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.

  • Thanks for help.

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

  • 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/

    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.

Log in to reply