cancel
Showing results for 
Search instead for 
Did you mean: 

problem with cron

problem with cron

hi 

i have now installing magento 2 but i have a problem with croc, How i can create it, i utilized a hosting and i create a cron task from him, but on magento 2 don't look, what i do ?

thanks

3 REPLIES 3

Re: problem with cron

Hi @Gax80 
You need to set default cron on the server.

 

/1 * * * * php -c <ini-file-path> <your Magento install dir>/bin/magento cron:run

*/1 * * * * php -c <ini-file-path> <your Magento install dir>/update/cron.php

*/1 * * * * php -c <ini-file-path> <your Magento install dir>/bin/magento setup:cron:run



For example:

*/1 * * * * /usr/bin/php -c /etc/php7.2/apache2/php.ini /var/www/magento2/bin/magento cron:run > /var/www/magento2/var/log/magento.cron.log&

*/1 * * * * /usr/bin/php -c /etc/php7.2/apache2/php.ini /var/www/magento2/update/cron.php > /var/www/magento2/var/log/update.cron.log&

*/1 * * * * /usr/bin/php -c /etc/php7.2/apache2/php.ini /var/www/magento2/bin/magento setup:cron:run > /var/www/magento2/var/log/setup.cron.log&


I hope it will help you!

Re: problem with cron

 /usr/bin/phpHello @Gax80 

 

https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cron.html

 

please check above document for same.

 

by using below command 

crontab -l

you can how many cron task added on server.

 

then after you need to edit

crontab -e

where you need to setup magento cron

 

* * * * * /usr/bin/php /var/www/html/magento2/bin/magento cron:run | grep -v Ran jobs by schedule >> /var/www/html/magento2/var/log/magento.cron.log
* * * * * /usr/bin/php /var/www/html/magento2/update/cron.php >> /var/www/html/magento2/var/log/update.cron.log
* * * * * /usr/bin/php /var/www/html/magento2/bin/magento setup:cron:run >> /var/www/html/magento2/var/log/setup.cron.log

where /usr/bin/php you can find using below command

which php

/var/www/html/magento2/bin/magento : it is your magento dir

 

then save it, and then check var/log folder you can see magento.cron.log file will be create.

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: problem with cron

hi

i use plesk of my hosting but in my task not function, in attached my photoImmagine.png