Last active
April 14, 2025 13:41
-
-
Save Lysak/b98f2ac629f4bc71511b3c3f84558d66 to your computer and use it in GitHub Desktop.
laravel queue crontab with logging example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* * * * * cd /var/www/html2/laravel && sleep 5 && ./vendor/bin/sail php artisan queue:work --sleep=3 --tries=2 --max-time=3600 --stop-when-empty >> /var/www/html/laravel/storage/logs/crontab.log 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Laravel Queue Worker via Cron (with Docker Sail)
This cron job runs every minute to process Laravel queued jobs using Docker Sail. It includes a 5-second delay before starting and is configured to:
Sleep 3 seconds between job attempts
Retry failed jobs up to 2 times
Stop after 1 hour or when the queue is empty
Log all output (including errors) to crontab.log in the Laravel storage logs directory
Useful for lightweight queue management in containerized Laravel projects.