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.

    pm2 doesnt work with crontab

    Scheduled Pinned Locked Moved Troubleshooting
    45 Posts 8 Posters 14.2k 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.
    • S Offline
      sdetweil @plainbroke
      last edited by sdetweil

      @plainbroke piping is a technique of stitching together multiple commands to accomplish a task

      The vertical bar is called the pipe character
      Which takes the output of the left side and presents it as input to the right side , so its like forming a pipe

      When I want to find all the MagicMirror processes running in the background I do this

      ps -ef
      

      This give the processes and the command line used to start them
      But is a lot of data

      So I can filter that with grep , and I can pass in data on its stdin

      ps -ef | grep -i MagicMirror 
      

      That gives just the rows of the process list with MagicMirror on them

      But if I want to kill them I need the process id on each row
      That’s the second value on each row
      I can use the awk command to get that

      ps -ef | grep -i MagicMirror | awk ‘{ print $2}’
      

      Now I have the process ids and can issue the kill command with them

      ps -ef | grep -i MagicMirror | awk ‘{ print $2}’ |  xargs sudo  kill -9
      

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • evroomE Offline
        evroom @plainbroke
        last edited by

        @plainbroke said in pm2 doesnt work with crontab:

        @evroom,
        I get that nothing is found, when I run either of your suggestions.

        The journalctl -f shows the current activities.
        Simular to tail -f <filename>.
        So when there are none, you will see none.
        Use that when you know that a cron job is going to occur anytime soon.
        The --since "1 hour ago" searches for activities in the last hour.
        Change to, for example --since "24 hours ago" for activities in the last 24 hours.
        When nothing comes out, then indeed nothing happened (during the time period you are searching in).

        Other --since options:

        "today"
        "00:20"
        "2025-11-12"
        "2025-11-12 07:30:00"
        

        MagicMirror version: 2.33.0
        Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
        Raspbian GNU/Linux 12 (bookworm)

        Test environment:
        MagicMirror version: v2.33.0
        Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
        Raspbian GNU/Linux 12 (bookworm)

        1 Reply Last reply Reply Quote 0
        • mumblebajM Offline
          mumblebaj Module Developer @plainbroke
          last edited by

          @plainbroke Afternoon. What I was saying was that instead of sending your current output to a blackhole, >/dev/null >2&1, i meant sending it to a log file:
          30 07 * * 6,0 /usr/local/bin/pm2 start mm >> /home/pi/mon.log 2>&1. This will send the output of the command /usr/local/bin/ pm2 start mm to a log file residing at /home/pi/mof.log. You can then interrogate this log file to see if there were any errors when the command was executed.

          So, by pipe I meant redirect the output to somewhere.

          Check out my modules at: https://github.com/mumblebaj?tab=repositories
          Check my blog-post: https://mumblebaj.xyz/
          Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

          1 Reply Last reply Reply Quote 0
          • plainbrokeP Offline
            plainbroke
            last edited by

            @mumblebaj
            @sdetweil
            @evroom
            Thank you all for the information.
            I did not get to use it BUT I will save this information, so I do not have to ask again.
            I woke up this morning and crontab -e had started my MM like old times… It also shutdown MM last night like it used to…
            Tech is great when it does not try to give me a headache, trying to figure it out…

            Thanks again guys for all your help.
            I think I will close this as solved.
            Just Jeff

            Slow learner. But trying anyways.
            MM is on Raspberry Pi 4B w/8gb ram loaded on a 128gb nvme drive.
            Running Trixie and the latest MM version.

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

              @plainbroke awesome! Thanks for the feedback

              Sam

              How to add modules

              learning how to use browser developers window for css changes

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