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.

    Autorestart

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    15 Posts 6 Posters 5.4k 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
      cornusandu
      last edited by

      Good morning,
      I have setup in crontab to autorestart raspbian 2 times a week . Can I add a command in crontab to shut down magic mirror before restart? Pm2stop? Thank you for your help in advance

      1 Reply Last reply Reply Quote 0
      • BKeyportB Offline
        BKeyport Module Developer
        last edited by

        Assuming you have PM2 set up per instructions:

        #       min     hour    day     Mon      wkd    command
                 15      2       *       *        *      sudo reboot
                 13      2       *       *        *      pm2 stop mm
        

        The "E" in "Javascript" stands for "Easy"

        1 Reply Last reply Reply Quote 0
        • C Offline
          cornusandu
          last edited by

          not working:
          46 11 * * mon,fri root pm2 stop mm
          30 6 * * mon,fri root reboot
          (With root works the reboot but not pm2 stop mm)
          46 11 * * mon,fri pm2 stop mm (also without root pm2 stop mm is not working)
          30 6 * * mon,fri root reboot

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

            @cornusandu create a little script

            pm2 stop ?? (id or name)
            shutdown -r now
            

            but you shouldn’t have to shutdown MM manually

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • FoziF Offline
              Fozi Project Sponsor
              last edited by

              For executing a reboot you need sudo privileges for the crontab. Try this

              Open crontab with root privileges (sudo):
              $ sudo crontab -e
              
              Add the cronjob:
              # - reboots the MM everyday at 1:05 and 13:05
              # - redirects stdout and stderror to dev/null
              5 1,13 * * * sudo reboot >dev/null 2>&1
              
              Save and exit crontab.
              
              

              Please note the ‚sudo‘ before ‚crontab -e’ and don‘t forget ‚sudo‘ before ‚reboot‘.

              HowTo: Replace PIR Sensor with a RCWL-0516 Microwave Sensor

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

                @Fozi don’t use reboot…

                it is violent… use shutdown -r (restart)

                to close the file system properly

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                FoziF 1 Reply Last reply Reply Quote 0
                • FoziF Offline
                  Fozi Project Sponsor @sdetweil
                  last edited by

                  @sdetweil why violent? As far as I know reboot is an alias for shutdown -r and does exactly the same. At least that is info I found in multiple posts on stackexchange. Could you elaborate a bit on that? Just eager to understand the difference and to avoid a mistake in the future.

                  HowTo: Replace PIR Sensor with a RCWL-0516 Microwave Sensor

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

                    @Fozi i wasn’t aware of that… seems to me reboot always was forced hard…
                    so… maybe you are right…

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    FoziF 1 Reply Last reply Reply Quote 0
                    • FoziF Offline
                      Fozi Project Sponsor @sdetweil
                      last edited by

                      @sdetweil no, it‘s not a hard shutoff. You can easily check the activity on the SD card when executing reboot before it powers off. Means it stops obviously process and writes necessary data to the card first, just like shutdown.

                      HowTo: Replace PIR Sensor with a RCWL-0516 Microwave Sensor

                      1 Reply Last reply Reply Quote 0
                      • C Offline
                        cornusandu
                        last edited by

                        Thank you guys. It works now. I have a secondary issue. The calendar have on top a title , I called it “my calendar” , how can I increase the font size only if the title ? The events I already increased them but the title of the module is very small

                        Mykle1M 1 Reply Last reply Reply Quote 0
                        • Mykle1M Offline
                          Mykle1 Project Sponsor Module Developer @cornusandu
                          last edited by

                          @cornusandu said in Autorestart:

                          The calendar have on top a title , I called it “my calendar” , how can I increase the font size only if the title ?

                          Assuming the default calendar module, add this to your custom.css file and adjust accordingly…

                          .calendar .module-header {
                            color: yellow;
                            text-align: center;
                            font-size: 34px;
                          }
                          

                          Create a working config
                          How to add modules

                          C 1 Reply Last reply Reply Quote 0
                          • C Offline
                            cornusandu @Mykle1
                            last edited by

                            @Mykle1 thank you very much

                            Mykle1M 1 Reply Last reply Reply Quote 0
                            • Mykle1M Offline
                              Mykle1 Project Sponsor Module Developer @cornusandu
                              last edited by

                              @cornusandu said in Autorestart:

                              thank you very much

                              I’m guessing that worked for you. Cool. Enjoy your experience.

                              Create a working config
                              How to add modules

                              B 1 Reply Last reply Reply Quote 0
                              • B Offline
                                Ben4x4 @Mykle1
                                last edited by

                                @Mykle1 Similar issue but how can i increase the font size of the dates? Thanks

                                Mykle1M 1 Reply Last reply Reply Quote 0
                                • Mykle1M Offline
                                  Mykle1 Project Sponsor Module Developer @Ben4x4
                                  last edited by

                                  @Ben4x4

                                  The dates? As in Thanksgiving and Christmas?

                                  .calendar .title.bright {
                                    font-size: 24px;
                                  }
                                  

                                  Keep in mind that the calendar module makes use of a table, including cells and line heights. If you make the text too large it will get ugly in a hurry. You might want to try zoom for the entire module. Just a thought.

                                  Create a working config
                                  How to add modules

                                  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