With wp cloneworx-backup scheduler you see when your backup plans run, and you trigger the schedule from the command line. The same command is the line for a system cron: with it your backups start on time, even if nobody visits the website.
WP-CLI still missing? The guide is in Install WP-CLI. All commands of the plugin are named in The commands at a glance.
How the schedule works
An active backup plan runs at its next scheduled time. For that, the plugin checks at every scheduler whether a plan is due. This check is called a tick. Schedulers are:
- the plugin’s own tick in WP-Cron, every 15 minutes,
- a wake event in WP-Cron that lies exactly on the next scheduled time,
- the open Overview or Backup page, every 60 seconds,
- the end of every job,
- the command line with
scheduler tick.
WP-Cron only runs when someone calls the website. If a scheduler comes within one hour after the scheduled time, the plan runs. After that the run counts as missed: nothing starts, the plan records the run, writes a warning to the general log and moves on to its next regular run. A website that has neither visitors nor a system cron around its scheduled times therefore makes no backups.
Only one job ever runs at the same time. If several plans are due, they run one after the other. A scheduled time that falls into a running job counts as met: the plan starts directly after this job.
Showing the schedule: status
scheduler status shows the state of the schedule. The action changes nothing and has no parameters. Without an action wp cloneworx-backup scheduler does the same.
# Show the status of the schedule wp cloneworx-backup scheduler status
The output is in English and names from top to bottom:
| Line | Meaning |
|---|---|
Now |
The time of the website and the grace period: 60 minutes. If a scheduler comes later, the run counts as missed. |
| one line per active plan | Identifier and name of the plan, the next run and the last run with its trigger. DUE NOW means: the plan is due now. missed names a missed run. could not start means: the plan could not start at its last scheduled time; the reason is in brackets. |
Wake event |
The time of the wake event, or none. |
Last tick |
The last tick with its scheduler in brackets, or never. |
Last start on schedule |
The last start according to the schedule: plan, backup, time, delay and scheduler. |
Active job |
The job that is running right now. The line is missing if none is running. |
If there is no active plan, it says no active plan. The schedulers are named in the output like this:
| In the output | Scheduler |
|---|---|
cron |
the tick of the plugin in WP-Cron |
wake |
the wake event |
rest |
the open page of the plugin in the browser |
cli |
the command line |
job_end |
the end of a job |
Running a tick: tick
scheduler tick runs a tick. What happens then depends on the situation:
| Situation | What the command does |
|---|---|
| No plan is due. | It names the plan with the next scheduled time and ends. If no plan is active, it says so. |
| A plan is due. | It starts the backup of the plan with the earliest scheduled time and drives it in this process to its end. After that follow the follow-up and the next due plan. |
| A job is already running. | It names the job and drives it to its end in this process. A due plan follows afterwards. |
| A run was missed. | It warns and names the plans. Nothing starts for this run. |
| A due plan cannot start. | It warns and names the reason. The run counts as done; the next one is scheduled. |
| Parameter | Meaning | Allowed values |
|---|---|---|
--background |
The command only starts the due plan. The website drives the backup on itself. | without a value |
--force |
Also runs as a different user than the one who owns the folders of the plugin. | without a value |
# Run a tick and drive a due backup here wp cloneworx-backup scheduler tick # Run a tick and leave the backup to the website wp cloneworx-backup scheduler tick --background
If a backup starts, the command names the plan, the scheduled time, the delay and the job name of the backup. After that follows the output as for a backup by hand: one line per step, the result at the end. It is described in Create and manage backups with WP-CLI.
Every tick also checks whether a backup is overdue, at most every 15 minutes.
The line for the system cron
A system cron is the schedule of the server. It calls the tick every five minutes, independently of visitors:
# Run a tick every five minutes */5 * * * * cd /pfad/zu/wordpress && wp cloneworx-backup scheduler tick --quiet
- The ready-made line for your installation, with the path to your WordPress, is on the Settings page in the tile Scheduler. The tile appears in the Extended view.
- The tile shows two lines. The first calls WP-CLI as above. The second calls
wp-cron.phpvia the address of the website. Copy copies the first line. - Enter the line in the cron of the user who owns the folders of the plugin. If the cron runs as another user, the command ends with an error and starts nothing.
-
--quietis a parameter of WP-CLI, not of the plugin.
How you enter the line at your hosting provider is shown in Start backups on time: set up a system cron.
Checking whether the system cron runs
Wait five minutes after entering it. Then scheduler status shows a time from the last few minutes in the line Last tick. If cli is in brackets, this tick came from the command line.
In this process or in the background
| Call | Who drives the backup |
|---|---|
scheduler tick |
The command itself, in its process, to the end. The setting Pause between steps does not apply here. The command only ends when the backup, the follow-up and every further due plan are finished. |
scheduler tick --background |
The website. The command starts the backup, sends the first self-request and ends at once. After that the job drives itself on through the web server; WP-Cron is the safety net below. |
If the self-request cannot be sent, the command warns. WP-Cron then continues the job. wp cloneworx-backup job status shows the progress of a job in the background.