Cron Job Manager for Magento 2

Overview

Cron Job Manager
EthanYehuda_CronJobManager

A Cron Job Management and Scheduling tool for Magento 2

Control Your Cron

Latest Stable Version Total Downloads Travis CI build status Coverage Status

Installation

In your Magento2 root directory, you may install this package via composer:

composer require ethanyehuda/magento2-cronjobmanager

php bin/magento setup:upgrade

Support

CJM Ver. Magento 2.0 Magento 2.1 Magento 2.2 Magento 2.3 Magento 2.4
1.x

Features

Full Control Over All Scheduled Cron Jobs

Take command of all processes running on your Magento 2 instance. You will be able to manage all scheduled cron jobs, which means you have complete control over what tasks fire behind the scenes. An administrator will have the ability of scheduling, removing, editing, analyzing, and running any, and all cron jobs in the cron_schedule table.

Informative Timeline

With the Timeline feature, you can see all scheduled tasks registered by Magento's scheduler queue, and quickly analyize important details pertaining to all your tasks. The timeline feature comes with dynamic scaling, live reloading, and tooltips to help you better interface with the scheduler.

Control Over Task Configurations

The configuration panel boasts a list of features including:

  • Cron expression editing

    Grants access to changing the frequency of any cron job in Magento

    This also allows you to disable cron jobs by removing the expression

  • System default configuration restore

    Revert back to the system's default configuration

  • Schedule Now

    Gives the ability to schedule any task immediately and in the background. Unlike the dispatch feature on the dashboard, which runs the cron on the forefront, scheduling a task from the configuration panel will allow the system to call it asynchronously

  • Cron Runner

    Forces Magento to run the scheduler queue on command

Command Line Tools

Use the command line tools to run any cron job and view all tasks in the system:

For example: php bin/magento cronmanager:showjobs

Email notifications

You can configure email addresses to be notified if a job has an error:

email-configuration

And Much More...

The Cron Job Manager is an arsenal of tools that administrators can use to manipulate Magento's scheduler features. It's perfect for debugging obscure issues with custom or native processes (cron jobs) that run on Magento's scheduler queue. There are many use cases where administrators need to keep track of tasks and force them to behave in a specific way. The Cron Job Manager can do it all!

Issue Tracking / Upcoming Features

For issues, please use the issue tracker.

Issues keep this project alive and strong, so let us know if you find anything!

We're planning on pumping out a ton of new features, which you can follow on our project page.

Development / Contribution

If you want to contribute please follow the below instructions:

  1. Create an issue and describe your idea
  2. Fork this repository
  3. Create your feature branch (git checkout -b my-new-feature)
    • NOTE: Always branch off the *-develop branch (ex. 1.x-develop)
  4. Commit your changes
  5. Publish the branch (git push origin my-new-feature)
  6. Submit a new Pull Request for review

Maintainers

Current maintainers:

See also our contributers

License

The Open Software License 3.0 (OSL-3.0)

Comments
  • PHP 8.1 | Deprecated Functionality: Function strftime() is deprecated...

    PHP 8.1 | Deprecated Functionality: Function strftime() is deprecated...

    After updating magento to 2.4.4 and PHP to 8.1, the module is unusable. When trying to run from the admin panel of the action 'Dispatch' or using the command 'cronmanager: runjob', errors related to 'Deprecated functionality' appear.

    This function is used several times in the module.

    Environment

    • Cron Job Manager Version 1.3.1
    • Magento Version 2.4.4
    • PHP Version 8.1
    opened by ssstankiewicz 10
  • Magento 2.4 support

    Magento 2.4 support

    We are working in 2.4 for current and future projects and had to fork this repo to get this module in. Would love to see 2.4 support.

    Describe the solution you'd like We have installed this locally on a 2.4 instance and don't see any issues. To add support, it's likely as simple as adding ~104.0.0 to the magento/framework requirement.

    Describe alternatives you've considered Another option would be to open up the magento/framework requirement to *.

    opened by kirkmadera 7
  • Timeline Performance Slows Down After ~2k records

    Timeline Performance Slows Down After ~2k records

    The timeline seems to slow down after hitting around 2k records in cron_schedule.

    Wild guess: This is likely due to all the subscribers KO has for each binding

    The goal of this Issue is to resolve problems with speed, and the amount of records we can handle in the timeline.

    There should be a "max" number of records we support because there's an argument that you shouldn't have over a certain amount of records stored in cron_schedule. We'll definitely want to get a specific number for this


    This is a follow up issue that was derived from issue #50

    opened by Ethan3600 7
  • Exception #0 (Exception): Notice: Undefined index: name

    Exception #0 (Exception): Notice: Undefined index: name

    On magento 2.2.3 when clicking on Job Configuration or Select > edit I get the below error:

    1 exception(s):
    Exception #0 (Exception): Notice: Undefined index: name in [store_path]/vendor/ethanyehuda/magento2-cronjobmanager/Model/Schedule/Source/Schedule.php on line 32
    
    High Bug 
    opened by refueledinc 7
  • Create Timeline Feature

    Create Timeline Feature

    Objective:

    Rebrand existing "timeline" as visualizer and create a new Timeline based on something like Google charts api

    The goal is to have a higher level perspective, over the visualizer, to gather a more granular view of cron jobs and where they are running.

    opened by Ethan3600 7
  • Fix PHP Fatal error on invalid job_code

    Fix PHP Fatal error on invalid job_code

    When running bin/magento cronmanager:runjob no_such_job the following error is encountered:

    Fatal error: Uncaught TypeError: Return value of EthanYehuda\CronjobManager\Model\ScheduleManagement::getGroupId() must be of the type string, null returned in /var/www/html/vendor/ethanyehuda/magento2-cronjobmanager/Model/ScheduleManagement.php:112

    This is because the return type declaration for EthanYehuda\CronjobManager\Model\ScheduleManagement::getGroupId() does not permit null to be returned. This pull request replaces the invalid return with an exception which can be caught as needed.

    opened by fredden 6
  • After installation, the static files are not being built correctly 404

    After installation, the static files are not being built correctly 404

    Hi Ethen The module looks great!!

    I get this issue: After installation, the static files are not being built correctly. Its building: pub/static/adminhtml/Magento/backend/en_US/EthanYehuda_CronjobManager/template.. and looking for: pub/static/adminhtml/Magento/backend/en_US/cronjobManager/template..

    I get 404 on the html requests

    opened by shayzalman 6
  • Fix testsuite and add coveralls.io integration

    Fix testsuite and add coveralls.io integration

    Integration tests are currently failing because email content hasn't been decoded before it is compared to the expected output. This pull request solves that problem by adjusting the test.

    This pull request also updates the branch names & PHP versions for Magento, and enables support for coveralls.io to help track unit test code coverage going forward.

    opened by fredden 5
  • Cronjob process monitoring

    Cronjob process monitoring

    Is your feature request related to a problem? Please describe. I want to see if a "running" cronjob is actually still running or has crashed

    Describe the solution you'd like

    • Show process id in grid
    • Regularly check if processes are still running, show "last seen" timestamp in grid
    • Add "kill" action
    opened by schmengler 5
  • Keep track of PID and clean up

    Keep track of PID and clean up "lost" processes

    Code

    Solves one requirement of https://github.com/Ethan3600/magento2-CronjobManager/issues/19 (Track PID of each cron job).

    Also adds another feature, cleaning of jobs in cron_schedude table that has status "running", but the process is missing from the current system. There is a system config to disable this behavior in admin.

    Seeing that this is a new feature added, I bumped the version to 1.6.0. I am fine with changing this if you wish.

    Background

    In our environment the cron process runs on a node that can be shut down and moved quite randomly, causing jobs to die mid-way through. This leaves a process in "running" status forever. It also stops any following jobs from running, except the scheduler. So that keeps adding all future jobs to the list, a few thousand per day. And that in turn puts enormous load on our DB server.

    I hope you'll accept this pull request, even though we did not discuss it first, I simply needed our issue solved right away, and seeing that this was on the roadmap anyway it seemed wrong to put it in it's own module.

    //Andre Klang PS: Thanks for your great module!

    Feature Improvement 
    opened by AndreKlang 5
  • "Schedule now"

    Using version 0.4.0 on Magento 2.1.10 in production mode i get this error:

    [Tue May 01 15:11:14.275469 2018] [proxy_fcgi:error] [pid 3946] [client 87.213.39.106:16732] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to EthanYehuda\\CronjobManager\\Controller\\Adminhtml\\Config\\Job\\MassScheduleNow::__construct() must be an instance of Magento\\Framework\\View\\Result\\PageFactory, instance of Magento\\Framework\\ObjectManager\\ObjectManager given, called in /var/www/vhosts/score/httpdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /var/www/vhosts/score/httpdocs/vendor/ethanyehuda/magento2-cronjobmanager/Controller/Adminhtml/Config/job/MassScheduleNow.php:19\nStack trace:\n #0 /var/www/vhosts/score/httpdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): EthanYehuda\\CronjobManager\\Controller\\Adminhtml\\Config\\Job\\MassScheduleNow->__construct(Object(Magento\\Framework\\ObjectManager\\ObjectManager))\n #1 /var/www/vhosts/score/httpdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\\Framework\\ObjectManager\\Factory\\AbstractFactory->createObject('EthanYehuda\\\\Cro...', Array)\n #2 ...\n', referer: https://support-score.itnova.nl/sitemanager_53RfIfauG6CnZGS/cronjobmanager/config/index/key/dd48cb763ad077fb2bf32652df3d040976b30970adfea962d9290b31a0943746/

    when i use the "Schedule now" option on from the Job configuration.

    i've done some debugging and found out that renaming magento2-cronjobmanager/Controller/Adminhtml/Config/job to magento2-cronjobmanager/Controller/Adminhtml/Config/Job

    solves the issue.

    opened by edkoster 5
  • Magento 2.4.5 - Status Column (html.js) not working

    Magento 2.4.5 - Status Column (html.js) not working

    Describe the bug The status column in the listing grid doesn't work with magento 2.4.5.

    [ERROR] Failed to load the "ui/grid/cells/html" template requested by "cronjobmanager_manage_grid.cronjobmanager_manage_grid.cronjobmanager_manage_columns.status".

    To Reproduce

    1. open grid in admin

    Expected behavior status column should show rendered status html

    Environment (please complete the following information):

    • magento 2.4.5

    Additional context Maybe I'm wrong but I don't see the need for the custom html.js EthanYehuda_CronjobManager/js/grid/columns/html

    I changed <item name="component" xsi:type="string">EthanYehuda_CronjobManager/js/grid/columns/html</item> to <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>

    and everything seems to work. But I'm not sure I'm considered all use cases.

    opened by mvenghaus 1
  • Remove filter toolbar override

    Remove filter toolbar override

    From what I can tell, view/adminhtml/web/template/visualizer/toolbar.html was a duplicate of https://github.com/magento/magento2/blob/a31f4a35c018ad09654e5bd5871086b73fbd3d2d/app/code/Magento/Ui/view/base/web/templates/grid/toolbar.html with the addition of a columnsProvider. That file (in Magento_Ui) was changed in https://github.com/magento/magento2/commit/5955a29bb38ba6dbcdae51fc2a6fc4f76be8ac57 to properly close the HTML tags. The local copy of the same here hasn't been updated to include this, so the filters aren't working on Magento v2.4.4.

    Actually we don't need this duplicate template, as we don't use the columnsProvider functionality, as far as I can tell.

    opened by fredden 1
  • Use default component for HTML cell

    Use default component for HTML cell

    From what I can tell, view/adminhtml/web/js/grid/columns/html.js was a duplicate of https://github.com/magento/magento2/blob/8b57fea479037f56c1d6e1b9ca76f0ebde95d2c9/app/code/Magento/Ui/view/base/web/js/grid/columns/column.js with a different default value for bodyTmpl. That file (in Magento_Ui) was changed in https://github.com/magento/magento2/commit/5955a29bb38ba6dbcdae51fc2a6fc4f76be8ac57 to include a new function. The local copy of the same here hasn't been updated to include this, so the column isn't showing up properly on Magento v2.4.4 (which also breaks the filters).

    Actually we don't need this duplicate component, as we can set the value of bodyTmpl for the particular cell that needs it, and use the component that comes with Magento_Ui as-is, which will remain up-to-date with the associated templates as we're not overriding those.

    Fixes #186

    opened by fredden 0
  • Retry jobs which fail or have gone missing

    Retry jobs which fail or have gone missing

    This is a feature suggestion. When jobs fail or have been detected as 'gone away', it would be helpful to be able to automatically retry these jobs. I've set the default to ignore 'failed' jobs, but to automatically retry 'missing' jobs.

    I'm happy to discuss this / receive feedback about this feature.

    opened by fredden 2
  • Get the ID of the admin user that scheduled the currently running job?

    Get the ID of the admin user that scheduled the currently running job?

    For M1 we've been using https://github.com/AOEpeople/Aoe_Scheduler. Your extension has proven to be a wonderful successor for us to use in M2.

    However, there is one requirement we haven't been able to solve yet.

    When a method is run, we'd like to be able to check if it has been executed by a cron job. If yes, we'd like to get the admin user ID of the admin user that initially scheduled the job.

    A little background: We've been using this logic for exporting large datasets. An admin user could schedule a custom export of a large dataset (e.g. all orders). This would add an entry into the cron schedule. As soon as the scheduled job has been executed, we'd then send an email to the admin user that initially requested the export.

    Here is some pseudo-code showing how we were able to do this in M1:

    // In an adminhtml controller, we schedule the job
    Mage::getModel('aoe_scheduler/api')->schedule($jobCode);
    
    // This is inside the method that was run by the job
    $currentJob = Mage::registry('currently_running_schedule');
    if($currentJob && $currentJob->getScheduledBy()) {
        $scheduledBy = $currentJob->getScheduledBy(); // This is the ID of the admin user that initially scheduled the job (see above)
        // Do something with the Admin User ID
    }
    

    Is there a proposed solution for this use case using your extension?

    Thanks!

    opened by mobweb 6
Releases(v1.13.2)
Task Scheduling with Cron Job in Laravel

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Shariful Islam 1 Oct 16, 2021
Manage all your cron jobs without modifying crontab. Handles locking, logging, error emails, and more.

Jobby, a PHP cron job manager Install the master jobby cron job, and it will manage all your offline tasks. Add jobs without modifying crontab. Jobby

null 1k Nov 27, 2022
Cron expression generator built on php8

The most powerful and extendable tool for Cron expression generation Cron expression generator is a beautiful tool for PHP applications. Of course, th

Pavel Buchnev 46 Nov 27, 2022
Schedule and unschedule eloquent models elegantly without cron jobs

Laravel Schedulable Schedule and Unschedule any eloquent model elegantly without cron job. Salient Features: Turn any Eloquent Model into a schedulabl

Neelkanth Kaushik 104 Sep 17, 2022
Crunz is a framework-agnostic package to schedule periodic tasks (cron jobs) in PHP using a fluent API.

Crunz Install a cron job once and for all, manage the rest from the code. Crunz is a framework-agnostic package to schedule periodic tasks (cron jobs)

Reza Lavarian 1.4k Dec 1, 2022
xcron - the souped up, modernized cron/Task Scheduler for Windows, Mac OSX, Linux, and FreeBSD server and desktop operating systems.

xcron is the souped up, modernized cron/Task Scheduler for Windows, Mac OSX, Linux, and FreeBSD server and desktop operating systems. MIT or LGPL.

CubicleSoft 6 Oct 5, 2022
Laravel Cron Scheduling - The ability to run the Laravel task scheduler using different crons

Laravel Cron Scheduling Laravel Task Scheduling is a great way to manage the cron. But the documentation contains the following warning: By default, m

Sergey Zhidkov 4 Sep 9, 2022
A better way to create complex batch job queues in Laravel.

Relay A better way to create complex batch job queues in Laravel. Installation composer require agatanga/relay Usage Example Let's say you have the fo

Agatanga 10 Sep 15, 2022
A PHP-based job scheduler

Crunz Install a cron job once and for all, manage the rest from the code. Crunz is a framework-agnostic package to schedule periodic tasks (cron jobs)

null 50 Nov 28, 2022
Cron Job Manager for Magento 2

EthanYehuda_CronJobManager A Cron Job Management and Scheduling tool for Magento 2 Control Your Cron Installation In your Magento2 root directory, you

Ethan Yehuda 265 Nov 24, 2022
CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due

PHP Cron Expression Parser NOTE This fork has been deprecated and development moved to https://github.com/dragonmantank/cron-expression. More informat

Michael Dowling 4.9k Nov 17, 2022
CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due

The PHP cron expression parser can parse a CRON expression, determine if it is due to run, calculate the next run date of the expression, and calculate the previous run date of the expression. You can calculate dates far into the future or past by skipping n number of matching dates.

Chris Tankersley 4.3k Nov 25, 2022
PHP cron job scheduler

PHP Cron Scheduler This is a framework agnostic cron jobs scheduler that can be easily integrated with your project or run as a standalone command sch

Giuseppe Occhipinti 692 Nov 16, 2022
Task Scheduling with Cron Job in Laravel

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Shariful Islam 1 Oct 16, 2021
Job Portal - Find your dream job here Various career opportunities await you

Find your dream job here Various career opportunities await you. Find the right career and connect with companies anytime, anywhere ?? free access to search for jobs, post resumes, and research companies. ??

Ossama Mehmood 샘 5 Nov 14, 2022
Improve default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel

Improve default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel , mapping of any format, Google Sheet, data and price modification, improved speed and a lot more!

Firebear Studio 173 Aug 18, 2022
Magento 2 - Cron Scheduler by KiwiCommerce

We're not maintaining this extension, if you need any support please contact us at [email protected] Magento 2 - Cron Scheduler by KiwiCommerce

KiwiCommerce 76 Sep 28, 2022
Message Queue, Job Queue, Broadcasting, WebSockets packages for PHP, Symfony, Laravel, Magento. DEVELOPMENT REPOSITORY - provided by Forma-Pro

Supporting Enqueue Enqueue is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and

Enqueue 2.1k Dec 4, 2022
Manage all your cron jobs without modifying crontab. Handles locking, logging, error emails, and more.

Jobby, a PHP cron job manager Install the master jobby cron job, and it will manage all your offline tasks. Add jobs without modifying crontab. Jobby

null 1k Nov 27, 2022