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 schedule of WordPress: with the plugin’s own task every 15 minutes and with a wake event set to the next run,
- 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 calls the website. If a task source comes 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.
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, the second line from step 3 remains.
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) names when the plugin’s own task in WP-Cron last ran.
- Last tick names 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 names the time at which WP-Cron wakes the plugin for the next run.
- Next run names the next run and its plan.
- Missed runs names per plan how many runs were missed and when the last one was.
- Check task sources starts a short probe run.
- Copy copies the first of the two lines for the system cron.
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 picks it up.
- The message Probe run finished; picked up by: …. names the task sources, usually the self-request.
If no task source picks up 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. 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 way: a due backup runs to the end within this call.
- 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.
Copy copies the first line. The page reports Copied to the clipboard. You select and copy the second line by hand.
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.
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 come for more than two hours. If none has ever come, 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 names since when no automatic task source has come.
- The line names 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 names 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 general 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