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 listed in The commands at a glance.
How the schedule works
An active backup plan runs at its next scheduled time. To do so, the plugin checks on every task source whether a plan is due. This check is called a tick. The task sources are:
- the plugin's own tick in WP-Cron, every 15 minutes (with cloneworx Backup Pro every 5 minutes),
- a wake event in WP-Cron that is set exactly to 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 opens the website. If a task source arrives 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 global 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 runs at a time. With cloneworx Backup Pro several plans can be due at the same time; they then run one after the other. A scheduled time that falls within a running job counts as kept: 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 shows from top to bottom:
| Line | Meaning |
|---|---|
Now |
The time of the website and the grace period: 60 minutes. If a task source arrives later, the run counts as missed. |
Job chain running since |
The time since which the current chain of jobs has been running. A plan that became due shortly before that runs after the chain. The line is missing when no chain is running. |
| 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 marks a missed run. could not start means: the plan could not start at its last scheduled time; the code is in brackets, followed by the reason in plain text. |
Wake event |
The time of the wake event, or none. |
Last tick |
The last tick with its task source in brackets, or never. |
Last start on schedule |
The last start according to the schedule: plan, backup, time, delay and task source. |
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 task sources have these names in the output:
| 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 shows 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 runs it to the end in this process. The follow-up and, with cloneworx Backup Pro, the next due plan come after that. |
| A job is already running. | It shows the job and runs it to the end in this process. A due plan follows afterwards. |
| A run was missed. | It warns and lists the plans. Nothing starts for this run. |
| A due plan cannot start. | It warns and shows the reason. The run counts as done; the next one is scheduled. |
| A plan that is switched on does not run on schedule. |
Switched on, but not run on schedule: … The command warns and names the plans. wp cloneworx-backup plan list shows the reason for each plan. |
| Parameter | Meaning | Allowed values |
|---|---|---|
--background |
The command only starts the due plan. The website continues the backup 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 shows the plan, the scheduled time, the delay and the job name of the backup. After that comes the same output as for a backup by hand: one line per step, the result at the end. This output 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 runs the tick every five minutes, regardless 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 continues itself through the web server; WP-Cron is the safety net. |
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.