19
votes
Accepted
How to create custom Module Development in magento 2 from Scratch?
Namespace: Mastering\Itdesire
1.How to Create Module
Mastering/Itdesire/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
15
votes
How to make sure your Magento 2.0 cron job is running
Truncate the cron_schedule table and see if it gets re-populated with scheduled tasks after a few minutes.
Rough, I know, but should give you an answer.
Also, maybe it's worth doing this on a ...
13
votes
Accepted
Magento 2 Could not acquire lock for cron group: default
In our case the issue was caused by a hanging cron job. The solution was to kill the cron job then everything returned to normal.
https://help.nexcess.net/magento/how-to-find-and-remove-hanging-...
11
votes
Magento 2 cron not working
Flush Cache and Run Cron again.
php bin/magento cache:flush
php bin/magento cron:run
11
votes
Accepted
Magento 2: how to use a configuration field for the crontab expression?
Following ProductAlerts in M2:
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http:...
11
votes
How to set cronjob dynamic schedule from database in Magento 2
Not as easy as I expected.
First you need to update your crontab.xml to setup the config path to your frequency:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
10
votes
Accepted
Magento 2: How to set cron for reindex in SSH in magento 2?
You can launch reindex a separate index as independent process, like:
* * * * * /usr/bin/php /Users/uchuhlebov/web/m212/www/bin/magento indexer:reindex catalog_category_product >> /Users/...
10
votes
Accepted
Magento 2: CronJob bug? MySQL is always running at 30% usage and many php processes are running
My best guess,
See this at stackexchange and this at github. The issue somehow appears as some cronjobs aren't indicated as completed. It freaked me out for quite some time.
The quick diagnosis to ...
8
votes
Accepted
Cron not running
Magento cron jobs will occasionally freeze. You may notice the cron
job has failed to run at its designated time or times, or you may
receive notification of a cron job failing to run when you log ...
8
votes
Accepted
Magento2 how to check if cronjobs are correctly set?
I am going to explain three different ways to test if your cronjobs are working properly.
First of all
Magento creates three log files, which are var/log/magento.cron.log, var/log/update.cron.log ...
6
votes
Magento 2 cron not working
If flushing the cache with php bin/magento cache:flush doesn’t work for you, check the cron_schedule table and look for your Job Code there. Chances are one of the instances is stuck with status "...
6
votes
Accepted
How to run a specific cron job in Magento2
I think you can use magerun http://n98-magerun.readthedocs.org/en/latest/commands/sys.html#sys-cron-run
Regards!
6
votes
Accepted
What is the best method to clear logs?
In simple way,you can do it.
Create a php script at Magento application root dir where cron.php file is located.
the using mysql query truncate data from database table
add This php script at ...
5
votes
Magento 2 set store_id and website_id in crontab
There is a way you can set store id for crontabs.
You may use emulation feature of magento.
$this->emulation->startEnvironmentEmulation($store_id, \Magento\Framework\App\Area::AREA_FRONTEND, ...
5
votes
How to create custom Module Development in magento 2 from Scratch?
11.Custom Grid In admin as continued here exceeding length of file in above ans:
Mastering/Itdesire/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
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 ...
4
votes
Magento 2 cron not working
I think you need to restart your cron service in Host Server
Commands for RHEL/Fedora/CentOS/Scientific Linux user
If you are using Redhat (RHEL)/Fedora/CentOS Linux use the following commands.
...
4
votes
Accepted
Magento Cron Job is not working using module
app/code/local/FQLabs_Automail/Models/observer.php
is wrong, should be
app/code/local/FQLabs/Automail/Model/Observer.php
Refresh your configuration cache and you should then confirm that your ...
4
votes
Error from Updater Application Cron Script: Cron job has not been configured yet
Apparently theres a problem with a generated file somewhere
I went into {magento-directory}/setup/src/Magento/Setup/Controller/Environment.php
around Line 194
i commented out :
//$setupCheck = $...
4
votes
Accepted
How can I setup cron job in Wamp Windows?
Magento 2, there are three cron jobs required. Because windows doesn’t have cron, we have to use a bat file and configure it to run as a scheduled task as shown below:
Find the location of php....
4
votes
Magento 2.4.2 upgrade from 2.3.4 issue with crons
In magento 2.4 below cron command no longer exist
* * * * * /usr/bin/php /var/www/html/magento2/update/cron.php
* * * * * /usr/bin/php /var/www/html/magento2/bin/magento setup:cron:run
only below is ...
3
votes
Accepted
Is there any way to run core_email_queue_clean_up without having to send all emails in the queue?
You could use magerun sys:cron:run to execute only one cronjob command. For more info click here
3
votes
Magento 2: how to use a configuration field for the crontab expression?
You can achieve this same as magento 1
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<...
3
votes
Accepted
Retrieve cronjob_code or other params like schedule info of a cron job inside a cron function?
The cronjob methods can take a Mage_Cron_Model_Schedule parameter which contains the job metadata (you can even change it).
Example:
function cron_job(Mage_Cron_Model_Schedule $schedule)
{
$id = ...
3
votes
Accepted
Automatically cancel magento 2 pending orders after a specified amount of time?
One of the solutions is to create a cron job that will cancel the orders left waiting for payment X hour or days after they were created.
That way your stocks would be updated.
Here you can find ...
3
votes
Extension Migration : Aoe_Scheduler
I've been working on this for a while:
https://github.com/Ethan3600/magento2-CronjobManager
Hopefully it helps you out!
3
votes
magento 2: How to edit a cronjob/crontab schedule in the admin backend
I did something simple using cron schedule expressions like: */5 * * * *
app/code/My/Module/etc/crontab.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
3
votes
Cron job error SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock
please check this issue https://github.com/magento/magento2/issues/8933
and for quick solution backup and truncate the cron_schedule table
3
votes
How to set cron job periodically in magento?
Next time you want to check what value i should add on the cron schedule , take a look at this magical cron expressions finder.Crontab Guru Link
3
votes
Accepted
Magento2: I am getting placeholder images in cron tab. Need to get correct images in cron
This is my working code:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Catalog\Model\Product')->load($item->getProductId())...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
crontab × 231cron × 158
magento2 × 114
magento-1.9 × 53
magento-cron × 45
cronjobs × 18
magento-2.1 × 13
magento2.3 × 11
configuration × 9
module × 8
reindex × 7
schedule × 7
database × 6
magento-1 × 5
product × 4
php × 4
magento2.2 × 4
orders × 4
email × 4
magento-2.0 × 4
order-status × 4
indexer × 4
overrides × 3
magento2.2.2 × 3
magento-2.1.7 × 3