php - Cron job runs and stops mysteriously?
one text
Solution:
it might be many reasons for this kind of problem where your crontab suddenly stopped working.
it might be related to crontab user. to solve the problem, you can try to delete all crontabs for both root and other users.
You can catch the script error into a log file for better investigation as following.
*/15 * * * * ubuntu cd /var/www/html && php artisan schedule:run >> /tmp/script.log 2>&1
it might be related to the PHP config. Your script may run longer than your php.ini's max_execution_time and also check set_time_limit()
You can check cron log by using this command
tail -fn 100 /var/log/cronit might occur due to script file permission and ownership of script files. so make sure you give proper permission to the script file.
chmod +x yourscript.sh chown root:root yourscript.sh
it might be related to OS. Maybe your webserver disk is full or an OS that can't spawn new threads.
Maybe your script has begun to overlap themselves and */15 * * * * is not enough. you can try to increase time to */30 * * * *