1
votes

I have created some commands and scheduled them to work periodically. A few months later I noticed that there is no cron job running but commands run without problem.

In the documentation, it says that I need to set a cron job in the operating system for scheduled commands to run. I couldn't find any. But artisan queue:listen command is run as daemon. Could this command be running the scheduled jobs as well?

Laravel 5.1 on Ubuntu 14.04

1
Did you mean this? laravel.com/docs/5.1/schedulingS.I.
I want you to know that "crontab -e" and "sudo crontab -e" are 2 different files.... so check in "sudo crontab -e" as well and let me know.kapil.dev
Is there anything listed when you sudo ls -al /var/spool/cron/crontabs/?maiorano84
If there's too much in there, you might be able to try sudo grep -rl "artisan" /var/spool/cron/crontabs/. I haven't tested that myself, but something like that might help.maiorano84
Run the following and post your results in your question: sudo cat /var/spool/cron/crontabs/www-datamaiorano84

1 Answers

1
votes

Basically, when a cron job is created, the associated crontab file is generated for each user that ran the actual command. When this particular artisan cron was generated, it was created by the www-data user, which was why you couldn't find it as easily.

Each crontab is stored as /var/spool/cron/crontabs/<username>, and should be open to something like Grep, or other commands to inspect their contents.

Once you find the correct crontab that needs to be adjusted, you can change the file by running sudo crontab -e -u <username>.