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

Cronjob doesn't work with my MM

Scheduled Pinned Locked Moved Troubleshooting
16 Posts 7 Posters 2.5k Views 7 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 Away
    sdetweil
    last edited by May 17, 2020, 11:30 AM

    @MisterT said in Cronjob doesn't work with my MM:

    [12:51:04.343] [ERROR] ERROR! Could not find main module js file for MMM-GooglemapsTraffic.original
    ATTENTION: default value of option force_s3tc_enable overridden by environment.
    [12:51:08.418] [ERROR] ERROR! Could not find main module js file for MagicMirror-Display-Controller
    [12:51:09.801] [ERROR] ERROR! Could not find main module js file for fabio

    you should add

    disabled: true,
    

    to those three modules in you config.js
    right after the module name

    the times don’t line up on the reports…
    cron log

    May 17 12:52:01 raspberrypi CRON[25574]: (pi) CMD (pi     pm2 stop MagicMirror >/dev/null 2>&1)
    

    pm2 log

    [12:55:40.854] [LOG]    Shutting down server...
    

    take this off the shutdown command
    pm2 stop MagicMirror >/dev/null 2>&1
    add a couple commands to the cron right in front of the shutdown

    pm2 info 0
    pm2 status 0
    

    these should output to the cron log

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    1 Reply Last reply Reply Quote 0
    • C Offline
      chassain 0 @MisterT
      last edited by May 17, 2020, 5:12 PM

      @MisterT

      PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
      SHELL=/bin/bash

      0 20 * * * pm2 stop mm
      0 6 * * 1-5 pm2 start mm

      1 Reply Last reply Reply Quote 0
      • M Offline
        MisterT
        last edited by May 18, 2020, 4:51 PM

        @chassain-0 i tried your solution but still not work, same with pm2 stop/start MagicMirror

        @sdetweil with this cron

        44 18 * * * pi pm2 start MagicMirror > pm2 status 0
        or
        46 18 * * * pi pm2 start MagicMirror > pm2 info 0

        i had a log in pi folder at the same time but a blank log

        I tested my cron with a simple Hello word .py and cronjob works.

        have you an other solution ?

        S 1 Reply Last reply May 18, 2020, 5:11 PM Reply Quote 0
        • S Away
          sdetweil @MisterT
          last edited by May 18, 2020, 5:11 PM

          @MisterT pm2 is a big node application, so if needs to be in the right folder and process

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • T Offline
            Tribun
            last edited by May 18, 2020, 9:44 PM

            Hello MisterT
            I’m not an expert, I’m more of a beginner, but I tried to use a cronjob to stop and start the mirror on my mirror.

            10 23 * * * pm2 stop mm> / dev / null 2> & 1
            15 23 * * * pm2 start mm> / dev / null 2> & 1
            it worked for me.
            I use the MagicMirror² v2.11.0 and NAME = “Raspbian GNU / Linux”
            VERSION_ID = “10”
            VERSION = “10 (buster)”
            VERSION_CODENAME = buster.
            With older versions of the software I always had problems starting MagicMirror because of access violations with pm2 after a reboot.
            Maybe this will help you solve your problem.

            1 Reply Last reply Reply Quote 0
            • B Offline
              bhepler Module Developer
              last edited by May 19, 2020, 12:06 AM

              Allow me to deliver a gentle reminder to use the markdown features of the forum when posting code and logs.

              1 Reply Last reply Reply Quote 0
              • M Offline
                MisterT
                last edited by Jun 27, 2020, 6:46 PM

                Hi it’s me again
                So i made a fresh installation of raspbian buster and latest version of Magic mirror. I used the auto install from @sdetweil . At the end of autoinstall, a message appears and says: Do you want use pm2 to autostart your mirror?
                So i pressed yes.
                After this i restart my Magic mirror but it didn’t start with raspbian.

                I try my cronjob in crontab-e but nothing happen

                SHELL=/bin/sh
                PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
                01 00 * * *   pi      pm2 restart MagicMirror
                00 08 * * *   pi      pm2 restart MagicMirror
                10 16 * * *   pi      pm2 stop MagicMirror
                
                

                does this command line can resolve my problem from @sdetweil git script?

                bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/fixuppm2.sh)"
                

                Thx for next answers

                S 1 Reply Last reply Jun 27, 2020, 6:48 PM Reply Quote 0
                • S Away
                  sdetweil @MisterT
                  last edited by sdetweil Sep 19, 2021, 12:43 PM Jun 27, 2020, 6:48 PM

                  @MisterT i have seen this a couple times… not sure why,

                  run the fixuppm2.sh script from my repo and see if that fixes the problem

                  one line to copy/paste

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  M 1 Reply Last reply Jun 29, 2020, 4:26 PM Reply Quote 0
                  • M Offline
                    MisterT @sdetweil
                    last edited by Jun 29, 2020, 4:26 PM

                    @sdetweil i apply your command line and magic mirror starts with raspbian. I’ll come back if i have problems with my crontab
                    Thx

                    1 Reply Last reply Reply Quote 0
                    • BKeyportB Offline
                      BKeyport Module Developer
                      last edited by Jun 29, 2020, 5:48 PM

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      • 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