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 userBut, 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 pm2Should give you that path
-
@sdetweil That was the solution. Thank you!
29 14 * * * /usr/local/bin/pm2 start mm.sh >/dev/null >2&1 -
D DDE12 has marked this topic as solved on
-
-
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
-
S sdetweil referenced this topic on
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