Is there anyway to export the Magento cron job in a list? If possible, including the schedule will be prefect. thanks
-
all Magento cron jobs ?– Hamendra SunthwalSep 23, 2020 at 4:50
-
yes, I need the magento cron job list– Paul FanSep 23, 2020 at 20:45
-
+1 for answer acceptance :)– Shoaib MunirSep 24, 2020 at 4:11
1 Answer
You can get all scheduled cronjobs from database by using this query
SELECT c.job_code, c.scheduled_at FROM cron_schedule c
WHERE c.`status` = 'pending'
GROUP BY c.job_code;
From above query you can find cronjob name with next scheduled timing.
For proper scheduling of cron you can find in your code with job_code
. The scheduling will be in cronjob.xml
file of module.
It is better to use IDE that finds sting in code, and you will be able to find it
-
Thanks! is it the job status = pending is include all the cron job? or just the job still pending? and they are not include running or success cron job?– Paul FanSep 24, 2020 at 18:35
-
This will show all the cronjobs, actually if cronjob is active, it will always appear in pending jobs, so that next time it will run on schedule Sep 25, 2020 at 6:41
-
Or else, you can remove pending status from query and compare both list Sep 25, 2020 at 6:42