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

Schedule restart MagicMirror

Scheduled Pinned Locked Moved Unsolved Troubleshooting
6 Posts 5 Posters 761 Views 6 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.
  • C Offline
    cldparisi
    last edited by Dec 11, 2022, 10:06 PM

    “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 Dec 11, 2022, 11:47 PM Reply Quote 0
    • W Offline
      Wenike @cldparisi
      last edited by Dec 11, 2022, 11:47 PM

      @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 Away
        sdetweil @cldparisi
        last edited by Dec 12, 2022, 12:11 AM

        @cldparisi u have to schedule as the user not root

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        M C 2 Replies Last reply Dec 12, 2022, 12:38 PM Reply Quote 0
        • M Offline
          MyMirror @sdetweil
          last edited by MyMirror Dec 12, 2022, 12:39 PM Dec 12, 2022, 12:38 PM

          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 Offline
            cldparisi @sdetweil
            last edited by Dec 14, 2022, 8:46 PM

            @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 Dec 18, 2022, 4:12 AM Reply Quote 1
            • P Away
              plainbroke @cldparisi
              last edited by Dec 18, 2022, 4:12 AM

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

              Slow learner. But trying anyways.

              1 Reply Last reply Reply Quote 1
              • 1 / 1
              1 / 1
              • First post
                2/6
                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