A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
Help with Crontab starting pm2 mm.sh
-
I am using Rasp Pi Bookworm on a Libre Sweet Potato.
In my user Crontab:
29 14 * * * pm2 start mm.sh >/dev/null >2&1sweetpotatopi:~ $ sudo systemctl status cron ● cron.service - Regular background program processing daemon Loaded: loaded (/lib/systemd/system/cron.service; enabled; preset: enabled) Active: active (running) since Mon 2025-02-03 14:27:37 EST; 1min 55s ago Docs: man:cron(8) Main PID: 2402 (cron) Tasks: 1 (limit: 1986) Memory: 368.0K CPU: 165ms CGroup: /system.slice/cron.service └─2402 /usr/sbin/cron -f Feb 03 14:27:37 sweetpotatopi systemd[1]: Started cron.service - Regular background program processing daemon. Feb 03 14:27:37 sweetpotatopi cron[2402]: (CRON) INFO (pidfile fd = 3) Feb 03 14:27:37 sweetpotatopi cron[2402]: (CRON) INFO (Skipping @reboot jobs -- not system startup) Feb 03 14:29:01 sweetpotatopi CRON[2409]: pam_unix(cron:session): session opened for user user(uid=1000) by (uid=0) Feb 03 14:29:01 sweetpotatopi CRON[2410]: (user) CMD (pm2 start mm.sh >/dev/null >2&1) Feb 03 14:29:01 sweetpotatopi CRON[2409]: pam_unix(cron:session): session closed for user user
But, the mirror is not starting.
~ $ pm2 show mm Describing process with id 0 - name mm ┌───────────────────┬────────────────────────────────────┐ │ status │ stopped │ │ name │ mm │ │ namespace │ default │ │ version │ N/A │ │ restarts │ 0 │ │ uptime │ 0 │ │ script path │ /home/user/mm.sh │ │ script args │ N/A │ │ error log path │ /home/user/.pm2/logs/mm-error.log │ │ out log path │ /home/user/.pm2/logs/mm-out.log │ │ pid path │ /home/user/.pm2/pids/mm-0.pid │ │ interpreter │ bash │ │ interpreter args │ N/A │ │ script id │ 0 │ │ exec cwd │ /home/user │ │ exec mode │ fork_mode │ │ node.js version │ N/A │ │ node env │ N/A │ │ watch & reload │ ✘ │ │ unstable restarts │ 0 │ │ created at │ 2025-01-30T12:31:59.717Z │ └───────────────────┴────────────────────────────────────┘ Divergent env variables from local env ┌────────────────┬──────────────────────────────────┐ │ _LXSESSION_PID │ 1234 │ │ SSH_AUTH_SOCK │ /tmp/ssh-rK5CMznThwsE/agent.1234 │ │ SSH_AGENT_PID │ 1326 │ └────────────────┴──────────────────────────────────┘
What do I have wrong? Thank you for taking a look at this.
-
@sdetweil That was the solution. Thank you!
29 14 * * * /usr/local/bin/pm2 start mm.sh >/dev/null >2&1
-
@DDE12 anotgeruser had trouble, turned out he needed the full path to pm2
which pm2
Should give you that path
-
@sdetweil That was the solution. Thank you!
29 14 * * * /usr/local/bin/pm2 start mm.sh >/dev/null >2&1
-
-
-
Now I have
PATH=/usr/local/bin:/usr/bin:/bin 00 7 * * * pm2 start mm >/dev/null 2>&1
-
-
@sdetweil Like so
PATH=/usr/local/bin:/usr/bin:/bin 00 7 * * * pm2 start mm &>/dev/null
-
@DDE12 yes
-