- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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.
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Cron Jobs problem, please help
Hello @tattoowizards
php bin/magento cron:run --group="default"
If you've found my answer useful, please give"Kudos" and "Accept as Solution"
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Cron Jobs problem, please help
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?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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.
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Cron Jobs problem, please 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))
- Generate Schedules Every: 15
- Schedule Ahead for: 20
- Missed if Not Run Within: 15
- History Cleanup Every: 10
- Success History Lifetime: 60
- Failure History Lifetime: 600
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Cron Jobs problem, please help
But I'm on windows so "install" command is not working there ...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Cron Jobs problem, please help
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