php - manually call cron job action programmatically in shopware

522

I'm new in shopware.

I want to call cron job function programmatically is there any way ?

I have tried following for call function using command line but getting too many argument error.

php bin/console sw:cron:run ACTION-NAME
php bin/console sw:cron:run NAME -f

I need one more help is use shopware function out side of shopware my custom file. is it possible ?

Thanks in advance.

783

Answer

Solution:

You can run the specific cronjob by following command. For example:

php bin/console sw:cron:run Shopware_CronJob_ClearHttpCache

But it's only possible since Shopware 5.1.6, not as Shopware says since 5.1.5.

263

Answer

Solution:

In case you need just run cron job for testing, you can run cron from browser:

http://www.myshop.com/backend/cron

There need to replacemyshop.com to your domain. In this case all cron jobs will be handled by opening this link.

In case for some reason you need to run cron via console, you can do it this way:

php5 path_to_shopware/shopware.php /backend/cron

There need to replacepath_to_shopware to your server path.

People are also looking for solutions to the problem: apache - PHP - file upload won't work on strato server

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.