MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    UNSOLVED Schedule restart MagicMirror

    Troubleshooting
    5
    6
    194
    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.
    • C
      cldparisi last edited by

      “pm2 restart MagicMirror” in prompt works correctly but I can’t schedule it.

      In crontab I write:
      0 4 * * * pm2 restart MagicMirror

      but 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

      W S 2 Replies Last reply Reply Quote 0
      • W
        Wenike @cldparisi last edited by

        @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?

        1 Reply Last reply Reply Quote 0
        • S
          sdetweil @cldparisi last edited by

          @cldparisi u have to schedule as the user not root

          Sam

          Create a working config
          How to add modules

          M C 2 Replies Last reply Reply Quote 0
          • M
            MyMirror @sdetweil last edited by MyMirror

            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

            1 Reply Last reply Reply Quote 0
            • C
              cldparisi @sdetweil last edited by

              @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

              P 1 Reply Last reply Reply Quote 1
              • P
                plainbroke @cldparisi last edited by

                @cldparisi

                My crontab -e looks like this.

                00 08 * * * pm2 restart mm
                30 21 * * * pm2 stop all

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

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy