0

I have currently installed sendy email sending script on amazon ec2 instance on php version 7. The problem I am facing is that whenever we create a new campaign the new campaign it simply shows pending and does not progresses. To resolve it I have to reset the cron job and again add the cron job command in crontab files which makes the sendy send email but again it fails.

*5 * * * /php /var/www/html/schedular.php 

The command is something like as shown above. What could be the reason for cronjob not working after every time I reset it . I am not getting any error messages in the log files. What could be the possi ble reason for this issue.

COdeingNinja
  • 381
  • 5
  • 20

2 Answers2

0

The schedular.php is located in /var/www/html/ folder or inside the project folder? If the scheduler is inside the project folder then please update the cron with specific folder. If you use laravel then just update the cron:

*5 * * * * php /var/www/html/artisan schedule:run >> /var/log/cron.log 2>&1
Shamir Imtiaz
  • 138
  • 1
  • 6
  • thank you for quick respone it is located inside the html folder and file is schedular.php. It is not inside the folder and sendy script does not uses laravel as framework so it won't help. But thanks for your time – COdeingNinja Sep 21 '21 at 07:03
  • Understood the issue. I think the command is not properly executed. You can try this: `*5 * * * php -f /var/www/html/schedular.php ` – Shamir Imtiaz Sep 21 '21 at 07:06
0

Try adding the location of your PHP before your script like so

*5 * * * /usr/bin/php /var/www/html/schedular.php

(Location of PHP may vary depend on your own circumstances)

trainmania100
  • 382
  • 2
  • 21
  • Well i have edited the question my whole command is this */5 * * * * php /var/www/html/scheduled.php > /dev/null 2>&1 – COdeingNinja Sep 21 '21 at 07:07
  • We need to see your code. Run the schedular command in your browser (assuming you have a web server) and check your error log at var/log/apache2/error.log or whichever you use. Maybe the code itself isn't progressing but we don't know because we can't see your scheduler code that could be failing – trainmania100 Sep 21 '21 at 07:34
  • thank you for your response. I have checked the error.log and it is showing me just some warnings. No specific error which is why it is more amusing. – COdeingNinja Sep 21 '21 at 07:56