Scheduled backups only start when something triggers your website. A system cron does that every five minutes, even when nobody visits the website. This is how you set it up and check whether it runs.
What a task source is
A task source triggers the plugin: it starts the next step of a running job and makes the plugin check whether a backup plan is due. The plugin checks whether a plan is due at these task sources:
- WP-Cron, the scheduler of WordPress: with the plugin's own task every 15 minutes (with cloneworx Backup Pro every 5 minutes) and with a wake-up event placed on the next due time,
- the open Overview or Backup page, every 60 seconds,
- the end of every job,
- the command line, and with it a system cron.
A job that is already running is also continued by the self-request: at the end of every step, the website calls itself.
WP-Cron only runs when someone accesses the website. If a task source runs within one hour after the scheduled time, the plan runs. After that, the run counts as missed: nothing starts, and the plan moves on to its next regular run. So without visitors and without a system cron around the scheduled times, no backups are made.
Backups every 5, 10, 15 or 30 minutes require a system cron that runs every five minutes, like the lines from step 3. These rhythms belong to cloneworx Backup Pro: Backups every 5 to 30 minutes.
What you need
- access to the cron jobs of your server: via the control panel of your hosting provider or via SSH,
- WP-CLI on the server: Install WP-CLI. Without WP-CLI, you can use the second line from step 3.
Step 1: Read the Scheduler tile
Open the Settings page, switch to the Extended view and click the title row of the tile Scheduler.
- WP-Cron shows how the schedule of WordPress is set: active, alternate mode (ALTERNATE_WP_CRON) or switched off, then with a yellow dot.
- Plugin task (every 15 minutes) shows when the plugin’s own task in WP-Cron last ran.
- Last tick shows the last automatic task source, with its type in brackets. If it is more than two hours ago while a plan is active, the dot is yellow.
- Self-request shows whether the website can call itself. This is how it continues a job without visitors. If red, the reason follows.
- Wake event shows the time at which WP-Cron wakes the plugin for the next run.
- Next run shows the next run and its plan.
- Missed runs shows, for each plan, how many runs were missed and when the last one was.
- Check task sources starts a short probe run.
- Copy appears next to each of the two lines for the system cron and copies that line.
Step 2: Check the task sources
Click Check task sources. The plugin starts a short probe run, which the page only observes. This shows which task source runs it.
- The message Probe run finished; last call from: …. shows the task source of the last call, usually the self-request. Below it are Last WP-Cron tick: …. and Last WP-CLI tick: …. Both lines show the date and time or never so far. The probe run itself is over within seconds; so only these two lines show whether a system cron arrives.
If no task source runs the probe run for a minute, the tile says so in red: the self-request and WP-Cron do not work here, you need a system cron. Abort probe run ends the probe run.
Step 3: Copy the line
At the bottom of the tile there are two lines, complete with the path to your WordPress and the address of your website. They are alternatives: between them is or; one of the two is enough. This is what they look like:
*/5 * * * * cd /pfad/zu/wordpress && wp cloneworx-backup scheduler tick --quiet */5 * * * * curl -s -o /dev/null 'https://example.com/wp-cron.php?doing_wp_cron'
- The first line calls WP-CLI every five minutes. This is the preferred option: a due backup runs to the end within this call. Below the line it says: This cron job must start as the user under which the web server runs WordPress (e.g. www-data). Otherwise the created files belong to the wrong user, and the website cannot change or delete them later.
- The second line calls WP-Cron via the address of the website every five minutes. The plugin task and the wake event then run even without visitors. This line works without WP-CLI. Below the line it says: May be run by any user; the web server executes the code itself.
Next to each line there is Copy: click the button next to the line you want to enter. The page reports Copied to the clipboard.
Step 4: Enter the line at your hosting provider
Enter the line as a cron job. There are two ways to do this:
-
In the control panel of your hosting provider, in the area for cron jobs. If the control panel asks for schedule and command separately,
*/5 * * * *is the schedule (every five minutes) and the rest of the line is the command. -
Via SSH on the server:
crontab -eopens the cron jobs of the logged-in user. Insert the line and save.
The first line belongs in the cron jobs of the user who owns the folders of the plugin. As a different user, the command aborts and starts nothing. Any user can run the second line.
Step 5: Check whether the system cron runs
Wait five minutes, a quarter of an hour for the second line, and open the Settings page. In the main tile, after Last scheduler run, there is a time from the last few minutes, in brackets the type of the task source, for example WP-CLI for the first line and WP-Cron for the second.
If the system cron runs, the main tile is green and reports Everything is ready. The tile is yellow when a plan is active and no automatic task source has run for more than two hours. If none has ever run, the two hours count from the last change to the active plan. The open page of the plugin does not count as an automatic task source.
- The result states since when no automatic task source has run.
- The line shows the last scheduler run with its type and whether the log is writable.
If something does not work
| What happens | What you can do |
|---|---|
| Last tick stays old. | Check whether the cron job is saved and switched on, and run the command from the line by hand. If the cron job does not find wp, write the full path, for example /usr/local/bin/wp. |
The command aborts. Its message contains This command runs as user. |
The cron job runs as the wrong user. The message shows the right one: enter the cron job for that user. |
| Missed runs stays yellow. | The line also counts what was missed earlier. What counts is the time after “last”: if it is before the system cron was set up, there is nothing to do. |
Good to know
A missed run is also shown on the Backup page until the plan has run again: in the Extended view in the row of the plan, as Missed run: … The global log contains a warning about it. You can start a plan by hand at any time.
See also
- Schedule backups automatically
- Create a backup right now
- Set up email notifications
- The “Settings” page
- Schedule and system cron with WP-CLI
On the command line
WP-CLI not set up yet? How to install WP-CLI.
The system cron calls the same command that you also run by hand. The plugin does not create the cron job itself.
# Show backup plans, next runs and the last tick wp cloneworx-backup scheduler status # Run a tick manually wp cloneworx-backup scheduler tick # Show the state of the website and the schedulers wp cloneworx-backup status