Lightsail Lamp Stack CRONS wont work

0

Hi.,

I have a LightSail running PHP LAMP stack 8.1, No matter how I try I cannot get crons to work correctly.

ps ax | grep cron Ss 0:00 /usr/sbin/cron -f pts/0 S+ 0:00 grep cron

service cron start -bash: service: command not found

service cron restart -bash: service: command not found

This is my Crontab -e

*/3 * * * * /usr/bin/curl -sS http://live.mysite.com/crons/cron.php >/dev/null >

*/3 * * * * WGET http://live.mysite.com/crons/cron.php >/dev/null 2>&1

*/3 * * * * php -q /opt/bitnami/apache/htdocs/crons/cron.php >/dev/null 2>&1


Am I Doing something wrong?

Jayanga
질문됨 6달 전175회 조회
1개 답변
0
수락된 답변

Hello.

Try running the following command to start it.

sudo systemctl start cron
sudo systemctl enable cron
sudo systemctl status cron
profile picture
전문가
답변함 6달 전
  • bitnami@ip-168-23-5-32:$ sudo systemctl enable cron Synchronizing state of cron.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable cron bitnami@ip-168-23-5-32:$ sudo systemctl start cron bitnami@ip-168-23-5-32:~$ sudo systemctl status cron ● cron.service - Regular background program processing daemon Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2023-11-13 04:43:46 UTC; 2 days ago Docs: man:cron(8) Main PID: 204143 (cron) Tasks: 1 (limit: 1116) Memory: 2.6M CPU: 52.326s CGroup: /system.slice/cron.service └─204143 /usr/sbin/cron -f

    Nov 15 06:00:01 ip-168-23-5-32 CRON[231900]: pam_unix(cron:session): session opened for user bitnami(uid=1000) by (uid=0) Nov 15 06:00:01 ip-168-23-5-32 CRON[231901]: (bitnami) CMD (/usr/bin/curl -sS http://live.seggobal.com/crons/cron.php >/dev/null 2>&1) Nov 15 06:00:01 ip-168-23-5-32 CRON[231900]: pam_unix(cron:session): session closed for user bitnami Nov 15 06:03:01 ip-168-23-5-32 CRON[231934]: pam_unix(cron:session): session opened for user bitnami(uid=1000) by (uid=0) Nov 15 06:03:01 ip-168-23-5-32 CRON[231935]: (bitnami) CMD (/usr/bin/curl -sS http://live.seggobal.com/crons/cron.php >/dev/null 2>&1) Nov 15 06:03:01 ip-168-23-5-32 CRON[231934]: pam_unix(cron:session): session closed for user bitnami Nov 15 06:06:01 ip-168-23-5-32 CRON[23203

  • It seems that cron is running.

  • yes. I checked from the server,,Its working again,,Lets check 2-3 days,, thanks for the help

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인