AD0-E725 practice question 3 of 10

An Adobe Commerce Developer is approached to disable several cron jobs from a customization completed by a third-party agency. The cron jobs will eventually be enabled again once a code review of the cron jobs is complete. Using best principles, how should the Developer action this request?

Full set: 50 questions
Answer options
A: Add the schedule="* * * * *" to the node in the crontab.xml file.
B: Edit the schedule with a date which will never happen in the crontab.xml file. Correct answer
C: Add the disabled="true" to the node in the crontab.xml file.
Correct Answer:
B. Edit the schedule with a date which will never happen in the crontab.xml file.
Explanation

To temporarily disable a cron job via configuration, the most effective method among the given options is to set its schedule to a non-existent date (e.g., 0 0 30 2 for February 30th). The Adobe Commerce cron scheduler interprets this schedule and will never find a matching time to queue the job in the cronschedule table for execution. This is a simple, configuration-based change that is easily reversible by restoring the original schedule, aligning with the temporary nature of the request.

Why Incorrect

A. This schedule ( ) configures the job to run every minute. This is the opposite of disabling the job and would significantly increase its execution frequency.
C. The disabled="true" attribute is not a valid attribute for the node within the crontab.xml file according to the official Adobe Commerce XML schema. This configuration would be invalid.

References

1. Adobe Commerce Developer Documentation

"Configure custom cron jobs and cron groups": This official documentation details the structure of the crontab.xml file. It specifies that the cron timing is controlled exclusively by the cron expression within the tag. This supports the conclusion that manipulating the schedule is the correct way to control execution.

Source: Adobe Commerce DevDocs

Custom cron jobs and cron groups. (The specific section on crontab.xml structure).

2. crontab.xsd XML Schema: The definitive source for the valid structure of crontab.xml is the XML Schema Definition (XSD) file included with Adobe Commerce. An inspection of this file confirms that the element does not have a disabled attribute.

Source: /vendor/magento/module-cron/etc/crontab.xsd. The xs:complexType definition for jobType lists only name

instance

method

and group as valid attributes.

Scroll to Top