Check Your JetBackup Backups with AI
Find out how old your newest JetBackup copies are, whether your schedules really run, and what failed. Read only.
Prerequisites
A site connected to WPVibe as an administrator (a network administrator on multisite), running JetBackup (tested on the free 3.1.24.10) on WordPress 6.9 or newer, with JetBackup, Settings, Security, WordPress Abilities API turned on (it is off by default). The check is read only.
My site uses JetBackup. Give me a health check of my backups. Read only: do not change anything. 1. Run discover_abilities with category jetbackup. If no jetbackup abilities are listed, stop and tell me to install or update the free JetBackup plugin (on WordPress 6.9 or newer) and turn on JetBackup, Settings, Security, WordPress Abilities API, which is off by default. If a jetbackup ability answers that I am not allowed, tell me WPVibe must be connected as an administrator (a network administrator on multisite), and that if JetBackup's two-factor login (MFA) is on, Allow Abilities API Access When MFA is Enabled must be on too, on the same tab. Then stop. 2. JetBackup answers in numbers. A backup's contains and a job's backup_contains: 1 is site files only, 2 is the database only, 3 is both (a full backup). A job's excludes are folders it leaves out and its database_excludes are database tables whose rows it leaves out. On top of those, JetBackup leaves out common clutter by default (Settings, Performance, Use Common Folder Excludes): caches, log files, other backup plugins' folders, and the rows of log, session and statistics tables of some common plugins (their structure is kept): WooCommerce sessions and logs, Action Scheduler logs, Yoast's link tables, Wordfence and Shield security logs, Activity Log, WP Activity Log and Simple History, WP Statistics, Redirection's logs, WPML's mails and UpdraftPlus job data, more than the list on that screen shows (Use Common Database Excludes); this does not show in a job's fields and it is mostly caches, logs and other backup plugins' folders (it also leaves out some cache plugins' config folders, such as wp-content/wp-rocket-config). A backup also never includes JetBackup's own plugin folder, so it does not cover updating JetBackup itself, and by default it leaves out another WordPress install nested inside the site (Excluded Nested WordPress Sites, same tab, one folder deep). A backup queue item whose job_id is not in list-backup-jobs belongs to a deleted job or to JetBackup's internal configuration job. A backup's schedules_names say how it was made: Manually means Run Now; Imported means it was brought in from elsewhere; Hourly, Daily, Weekly, Monthly or After Job Done is the kind of schedule that made it. Leave out imported backups (params.imported true, or Imported in schedules_names). Compare each backup's params.site_url with run_wp_cli option get siteurl, ignoring http, https and www: leave out backups made under another address, but list them by that address (a domain change or host move can be the reason) instead of hiding them. Leave out any backup whose deleted is not 0: JetBackup has marked it for removal. In the queue, type 1 is a backup; status below 100 means waiting or running, 100 completed, 101 partially completed, 102 failed, 103 aborted, 104 never finished. status_name is often empty, so go by the number. Backups do not say which job made them: a queue item's item_data.snapshot_name is the name of the backup it made and item_data.job_id its job, and the queue keeps finished items for 24 hours by default (JetBackup, Settings, Maintenance). Times (created, started, ended, last_run, next_run) are Unix timestamps: get the time now with run_wp_cli db query "SELECT UNIX_TIMESTAMP() AS now", and show me times in my site's time zone (run_wp_cli option get timezone_string, or option get gmt_offset when that is empty). 3. Run jetbackup/list-backups. JetBackup's lists come back in no fixed order, up to 50 at a time: run each with limit 25 and, while you have fewer items than total, again with skip set to how many you have. If a page adds no new _id, stop paging and say how many you have of total. If WPVibe says a result was cut, run that page again with a smaller limit and keep paging: these abilities only read, so running them again is safe. Drop duplicates by _id, say so if you still have fewer than total, and sort backups and queue items by created yourself. These are the backups that exist. Find the newest that has the database (contains 2 or 3) and the newest that has the site files (contains 1 or 3), and tell me how old each is, its size, where it is (destination_name) and how it was made. When one is from the last 24 hours, find its job through the queue in step 4 and say what that job leaves out in step 5. If there are none, say so plainly. 4. Run jetbackup/list-queue-items the same way. For each backup (type 1) with status 101 to 104, tell me its job (item_data.job_id), when it was created and started (an aborted one gets a start time when it is aborted, even if it never began), the status in words, and progress.message and progress.sub_message (the step it was on; for never finished, the message holds the error). If a backup is waiting or running, tell me which and its progress.message; one with status 1 that has said Waiting for cron... for more than a few minutes is waiting for something to move the queue. A progress.message or progress.sub_message containing Waiting for next cron (execution or iteration) only means it is between two runs: it shows while a backup is moving too. Only Waiting for cron... with status 1 means nothing has run it yet. One with status 2 to 99 whose started is more than an hour ago is paused or stuck, and one read cannot tell which: without a server cron job it only moves while an admin page is open, and JetBackup also retries a run that PHP stopped for memory or time instead of marking it failed. Tell me the step it is on and point me to https://wpvibe.ai/cookbook/find-out-why-a-jetbackup-backup-failed-with-ai/, which tells the two apart. 5. Run jetbackup/list-backup-jobs the same way. For each job tell me its name, whether it is enabled, what it backs up, what its excludes and database_excludes leave out (wp-content/uploads means no images or other media), where it saves (destination_names) and its schedules (schedule_names; a dash means it runs only when someone clicks Run Now). If no enabled job has a schedule, say plainly that nothing backs the site up on its own. Run jetbackup/list-schedules the same way: each _id in a job's schedules matches a schedule's _id there, with its type_name and intervals. The longest gap each allows between runs: Hourly, its intervals in hours; Weekly, 7 days; Monthly, the longest stretch between its days of the month (intervals, a list from 1, 7, 14, 21 and 28, wrapping into the next month); Daily, the longest stretch between its chosen days (intervals). For Daily, JetBackup's screen numbers Monday 1 to Sunday 7 but its scheduler reads Sunday as 0, so a Daily schedule never runs on Sunday, the default one included: count Sunday as skipped, and a Daily schedule with only Sunday ticked never runs at all. Allow 2 hours on top. A Monthly schedule whose intervals is a single number instead of a list, as JetBackup's own default Monthly schedule is, never runs: a job whose only schedule it is shows next_run 0. Say so, and tell me to open JetBackup, Schedules, click that schedule, Manage, tick its days of the month and save it. An After Job Done schedule never runs in 3.1.24.10: JetBackup sets its next run when the job it follows finishes and resets it to 0 in the same save, so a job whose only schedule it is never backs up on its own. Say so, and tell me to give that job an Hourly, Daily or Weekly schedule. For each enabled job with schedules, compare its next_run with now: 0 means it has no next run (see the Monthly and After Job Done rules above); more than an hour in the past means its backups are not being run. JetBackup does not use WordPress's scheduler (the WordPress Cron switch in its Settings, Automation has no effect in 3.1.24.10). Its queue, scheduled backups and Run Now included, only moves while an administrator (on multisite, a network administrator in the main site's admin) has a WordPress admin page open, or when a server cron job or JetBackup's public cron URL runs it. The open admin page and the public cron URL only move it when Cron Scheduling is on in JetBackup, Settings, Automation, and the admin page also needs Backend Heartbeat on; JetBackup's Cron Command run on the server works either way. Then find the job's newest backup: in the last 24 hours, through the queue: a completed item (status 100 or 101) whose item_data.job_id is this job's _id and whose item_data.snapshot_name is in list-backups, skipping items whose item_data.manually is true (Run Now does not show the schedule works); before that, the newest backup whose contains is the job's backup_contains, made by one of the job's schedule types (match a backup's schedules_names schedule_name to the schedule's type_name; never compare their ids), at one of its destination_names (if two jobs share all three, say you cannot tell their older backups apart). If that backup is older than the shortest of the longest gaps its schedules allow, say the job is not producing backups. If there is none, say so: that is expected only for a job set up within its first gap. Do not use last_run as the last good backup: a failed run updates it too. 6. Run jetbackup/list-destinations. If every destination the jobs use is Local, tell me every copy is on the same server as the site: that helps when an update goes wrong, not when the server or the hosting account is lost. The free JetBackup also saves to JetBackup's own cloud storage (2 GB free with a JetBackup account); Amazon S3, Google Drive, Dropbox and its other remote destinations need JetBackup premium. 7. Run jetbackup/get-system-info and jetbackup/get-dashboard. In get-system-info's system_checks: data_dir_secured false means JetBackup keeps its data and backups inside the WordPress folder, which it protects with .htaccess files; on servers that ignore those, such as nginx, anyone who learns a file's address can download the backups and logs (in our test on nginx, a backup log downloaded without signing in). Put this first when it is false, and tell me to move them outside the public folder with Settings, Security, Alternate Data Directory; post_max_size true means PHP's post_max_size is below what JetBackup recommends (data.recommended_post_max_size); php_compatible false means the PHP that runs JetBackup in the background is a different version from the site's PHP (set PHP CLI Binary Location in JetBackup, Settings, General, or ask the host); cron_run true means JetBackup's Cron Command (run on the server from the command line) has not run in over 10 minutes; false means it either ran in the last 10 minutes or was never set up, and the abilities cannot tell which, so ask me; runs through the public cron URL or an admin page do not count; heartbeat false means an open admin page does not move the queue; cron false means Cron Scheduling is off, so neither an open admin page nor the public cron URL runs the queue, only a command run on the server, such as JetBackup's Cron Command in a server cron job; pdo_mysql_buffered_query_available false means PHP lacks a database feature JetBackup checks for; jb_linux_status true is only a notice that JetBackup for Linux is on the server and not connected; isWindows is only information. Mention only what points at a problem. If the dashboard's alerts is above 0, tell me there are alerts on JetBackup's Alerts page to read: the abilities can count them but not read them, and some are only notices, such as a job added to the queue. 8. Finish with one line: my newest database copy is from DATABASE_TIME and my newest files copy is from FILES_TIME, or that I have none, and the one thing I should do first.
Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:
Run the “Check Your JetBackup Backups with AI” recipe from the WPVibe cookbook on my connected site.
JetBackup gets set up once and then nobody looks at it. A job without a schedule never runs, a schedule that nothing triggers never fires, and a failed backup still counts as the job’s last run. Nothing on the site looks different until the day you need a copy and the newest one is weeks old.
The AI reads JetBackup’s jobs, schedules, backups and queue and gives you one plain answer: how old your newest database and files copies are, which jobs run on a schedule and whether they really fire, what failed in the last day, and whether every copy sits on the same server as the site. It changes nothing and starts nothing.
Paste the prompt as it is after a host move or a big update, and once a month otherwise. JetBackup’s queue keeps finished items for 24 hours by default, so older failures show only as missing backups. If you have no recent full backup, this recipe gets you one.
Outcome
A short verdict: your newest database and files copies, whether each schedule really runs, what failed in the last day, and the one thing to fix first.