I installed magento 2.3.3 via composer on my windows 10, MAMP.
Trying to configure cron jobs but have trouble.
Command cron:install not working on windows, so I'm trying to make cron jobs work by these commands:
php bin/magento cron:run >> C:/MAMP/htdocs/var/log/magento.cron.log
php update/cron.php >> C:/MAMP/htdocs/var/log/update.cron.log
php bin/magento setup:cron:run >> C:/MAMP/htdocs/var/log/setup.cron.log
But it seems that cron jobs run just once when I execute these commands and not works after.
Please help me.
Solved! Go to Solution.
@tattoowizards Cron are linux function. In windows you have scheduled job. You can achieve what you are looking for but it can be tricky. Sometime you have to create a dat or exe file to achieve the same. Below is a link has similar discussion and may help.
Hello @tattoowizards
php bin/magento cron:run --group="default"
Thank you.
I already run this command as I mentioned in first post...
But this command is only runs cron jobs once.
It's not possible to properly adjust crons to run atumaticaly in windows, mamp?
@tattoowizards Cron are linux function. In windows you have scheduled job. You can achieve what you are looking for but it can be tricky. Sometime you have to create a dat or exe file to achieve the same. Below is a link has similar discussion and may help.
Hello @tattoowizards
You can use the following command to run manual cron job in localhost
Step 1 :
Stores > Settings-Configuration. On the left menu, under the Advanced section, click System. Expand the section Cron (Scheduled Tasks))
Step 2: Clear Cache in System > Cache Management.
TRUNCATE TABLE cron_schedule;
Step 3: php bin/magento cron:install
Steps 4: To check directly in the database
SELECT MAX(executed_at) FROM cron_schedule
Cron Log list of errors: SQL Query.
SELECT job_code, messages FROM cron_schedule WHERE messages IS NOT NULL
Scheduling to run a bat file as mentioned above is the best option for windows
you can also on schedule to run http(s)://yourhostname/cron.php instead if you can't schedule windows task, with services like https://www.easycron.com/
I'd recommend you switching to Linux if you can by any chance