How to properly set up cron jobs for Recurring Exports

Updated 2 years ago

Recurring Export is a powerful feature included in the ATUM Export Pro add-on to create custom scheduled exports. This tool requires properly setting up a cron job to make it work as desired.

What is a cron job?

A cron job is a task that is set to run at a specified frequency. For example, running an export once a day.

How do default WordPress cron jobs work?

The default WordPress cron job system is executed only when someone/something loads a page of your site. The system then checks if there are pending scheduled tasks and executes them if needed. So, some of those tasks could be executed out of time.

Also, with the default system, when users enter the site with cron tasks in the process, they must wait until all of them are complete. Only then they can load the requested page. Please note, it can affect the overall performance and the UX when some of those tasks need a long time to complete.

For reference, there is a full chapter dedicated to the cron system on the official’s plugin development handbook: https://developer.wordpress.org/plugins/cron/

That is the reason why the recurring export tool is not recommended to be used with the default WordPress cron job system.

How to set up real cron jobs in the OS task scheduler for Recurring Exports?

First of all, you will need to disable the default WordPress cron job system. You can do that following the steps below:

This is only for technically experienced users.
  • Navigate to your server WordPress installation and go to the wp-content folder.

  • Search the wp-config.php file.

  • Open the file with your text editor program.

We recommend doing a file backup before any editing.
  • Add the following code before the "/* That's all, stop editing! Happy blogging. */" line:

    define('DISABLE_WP_CRON', true);

Once you have disabled the default WordPress cron job system, you will need to set up the OS task scheduler. There are a lot of ways to do it. Some hosting providers include a Cron Job tool in their Control Panels. Here you have some tutorials that may help you, but if none of them suits you, we suggest you ask your hosting provider.

WordPress Codex
https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/

How to set up a real cron job in Siteground server
https://www.siteground.com/tutorials/wordpress/real-cron-job/

How to set up a real cron job in Kinsta server
https://kinsta.com/knowledgebase/disable-wp-cron/

How to set up a real cron job in HostGator server
https://support.hostgator.com/articles/specialized-help/technical/wordpress/how-to-replace-wordpress-cron-with-a-real-cron-job

How to set up a real cron job in Bluehost server
https://my.bluehost.com/hosting/help/411

How to set up a real cron job in any server
https://tommcfarlin.com/wordpress-cron-jobs/

Did this answer your question?