7 votes

Magento 2 - Test cronjob from browser

You may follow the steps below to test a cron job from browser. Step 1) Create a PHP file names "cronLaunch.php" under your project root directory FIle: cronLaunch.php <?php use Magento\...
6 votes

how to stop cron job runing in magento 2

You can by running cron remove command: php bin/magento cron:remove It will only remove cron tasks from crontab but not the exact cron codes/files. If you wish to run the cron jobs again, you ...
  • 4,502
5 votes
Accepted

Magento 2: How override native crontab.xml

Best way is to add this kind of record for core_config_data table : path : crontab/default/jobs/get_amazon_capture_updates/schedule/cron_expr value : 0 1 * * 1 scope: default scope_id: 0 You have to ...
  • 666
5 votes
Accepted

Magento 2 - Cache warmer for multiple server

In local cache environment it is impossible to create cache for both servers while executing cron on one server. There is only one option left, make cache centralize. To do this you need to use ...
  • 8,958
3 votes

Unable to send emails. Could not acquire lock for cron job: sales_send_order_invoice_emails

I guess Magento cron job is stuck in "running" status. Need to kill the stuck cron job then it will continue as scheduled. Log in to your account using SSH. Run the following command to ...
  • 3,814
3 votes

Magento 2 - Test cronjob from browser

I recommend you to use n98-magerun2 https://github.com/netz98/n98-magerun2 . After you give the n98-magerun2.phar execute permission you could run Get all available cron job list. ./n98-magerun2....
  • 1,263
3 votes

how to stop cron job runing in magento 2

Run this command in magento root CLI php bin/magento cron:remove NOTE : This command has no effect on cron jobs outside the #~ MAGENTO START and #~ MAGENTO END comments in your crontab. and to do ...
3 votes
Accepted

Magento 2 - How to get Base URL in cronjob

I think before calling getBaseUrl() you need to set your current store then you can get correct URL. $this->storeManager->setCurrentStore($storeId); Where $storeId is your store Id which you ...
  • 17.6k
3 votes
Accepted

How i Can Schedule A cron Job on the Basis of Admin Configurations Values

Maybe this is your idea, you should create a configuration: crontab.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="...
3 votes

Magento 2.2.8 - sitemap.xml contains "pub" DIR in the URL, It should be without "pub" directory in the URL

The reason is the way getBaseUrl function implemented on Magento\Store\Model\Store. public function getBaseUrl($type = UrlInterface::URL_TYPE_LINK, $secure = null) { ... ...
  • 341
3 votes
Accepted

Magento 2.3 How to automate custom cron job from custom module?

First you need to create your cron in Cron directory app/code/Vendor/Module/Cron/Mycron.php namespace Vendor\Module\Cron; class Mycron { protected $logger; public function __construct( ...
  • 8,958
2 votes
Accepted

Why do magento2 cronjobs need to be ran every minute?

The magento cron process is an internal queue which performs different actions (jobs) at different intervals. To keep these in time in needs to trigger once a minute to maintain the schedule. Think ...
2 votes

Magento2 Cron job for sending mail not working

This library helps to identify the issues. Run the below commands in the Magento root directory to download the n98-magerun2.phar. wget https://files.magerun.net/n98-magerun2.phar Then trigger your ...
  • 9,619
2 votes
Accepted

Schedule cron job every day

<crontab> <jobs> <ebayautopurchase_deleteproducts> <schedule><cron_expr> 0 */12 * * *</cron_expr></schedule> <run>&...
  • 750
2 votes

Magento2: How to check if cron job is working or not?

You can check all the cron jobs in any status in the table cron_schedule: Inside you can look for your job name in the job_code column. Other way is to use next query: SELECT * FROM `cron_schedule` ...
2 votes

catalog_product index does not exist yet. Make sure everything is reindexed

Please check https://github.com/Smile-SA/elasticsuite/issues/318#issuecomment-435322698, that fixed it for me. As this is a bit old, the command should be : bin/magento config:set catalog/search/...
1 vote
Accepted

How to run cron job at a particular time in Magento 2?

Add This Files to your Custom Module and first check your module is enable or not. Your Module must be enable. Create a class to run cron app/code/VendoreName/ModuleName/Cron Test.php <?php ...
  • 6,195
1 vote

Magento2: How to check if cron job is working or not?

You can run cron job with below command. php bin/magento cron:run Also, run the command from the root, crontab -l List all cron if you have cron otherwise display default cron. REF: https://...
  • 1,389
1 vote
Accepted

Magento2: How to check if cron job is working or not?

first, check if the cron job is installed or not if not then run these commands in your project root dir sudo php bin/magento cron:install then run this command to create cron jobs sudo php bin/...
  • 342
1 vote
Accepted

How To Set up Custom Cron Job in Magento 2?

First you need to create your cron in Cron directory app/code/Vendor/Module/Cron/Mycron.php <?php namespace Vendor\Module\Cron; class Mycron { protected $logger; ...
  • 2,593
1 vote

Prevent hanging cronjobs together with stack protection with flock

An idea would be to install a tool like Supervisor and use it to keep a custom script always up and running. In this custom script (maybe bash?) you could check the running time that a process ...
  • 4,793
1 vote
Accepted

how to setup cronjob in magento 1.9.3

In your modules config.xml put the following: <config> <global> <models> <dolphininvoicecron> <class>Dolphin_Invoice_Model</...
1 vote
Accepted

How to import products using csv file

Magmi Using magmi tool you can easily import update products. http://wiki.magmi.org/index.php/Magmi_Wiki 1.Copy magmi to your root directory and unzip it as (https://sourceforge.net/projects/magmi/) ...
1 vote
Accepted

How to get bundle product price by product id ? Magento2

Please try this: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->create('Magento\Catalog\Model\Product')->load($product_id); if ($product->...
  • 934
1 vote
Accepted

Magento 2 : How to run 2 cron jobs at the same time?

That should work. Although have you tried a different group? <config> <group id="default"> <job name="<job_1_name>" instance="<classpath>" method="<...
1 vote

Magento 2 cron error 'Process went away'

As @Oscprofessionals mentioned already in his comment: This is an issue with your PHP memory_limit. Check your PHP memory_limit: $ php -i | grep memory_limit You can try to run the cronjob manually ...
  • 17.2k
1 vote

Magento2: existing quote doesn't load through a cron job

Instead using Quote factory, use quote RepositoryrepMagento\Quote\Api\CartRepositoryInterface::getForCustomer This method needs two param $customerId, array $sharedStoreIds = [] So you have to ...
  • 76k
1 vote
Accepted

Magento2: existing quote doesn't load through a cron job

You can give a try with below code in your cron file for getting quote items with customer id. protected $quoteFactory; public function __construct( \Magento\Quote\Model\QuoteFactory $...
  • 4,705
1 vote

Magento 2.2.8 - sitemap.xml contains "pub" DIR in the URL, It should be without "pub" directory in the URL

Media directory is always in "pub" and the actual result is correct but when you want to browse it, you don't need to put "pub" in the URL. Try the direct URL: https://magento-site/media/sitemap-1-1....
1 vote

M2 Importer: Value for 'visibility' attribute contains incorrect value

This is a known issue, see https://github.com/magento/magento2/issues/3923 If the CSV data is in a different language(locale) than the locale of the default store view, the import will fail. Best ...

Only top scored, non community-wiki answers of a minimum length are eligible