Destination::PATH, 'id' => JetBackup::ID_FIELD ]; /** * Add item to the queue * * ## OPTIONS * * --type= * : The queue type (1 = backup, 2 = restore, 4 = download, 8 = reindex, 64 = export, 128 = extract) * * [--id=] * : The object id to add to queue (depend on the queue type, for backup - backup job id, for restore, download, export and extract - snapshot id, for reindex - destination id) * * [--snapshot_path=] * : The snapshot path to import (restore from file) * * [--panel_type=] * : The panel type to export to (1 = cPanel, 2 = DirectAdmin) * * ## EXAMPLES * * wp jetbackup addToQueue --type=2 --id=2 * wp jetbackup addToQueue --type=64 --id=5 --panel_type=1 * wp jetbackup addToQueue --type=2 --snapshot_path="/home/user/public_html/mybackup.tar.gz" * * @when after_wp_load */ /** * WordPress cli will not accept upper case flags (internal case #706) * @param array $flags * * @return array */ private static function _keyToUpper(array $flags): array { $array = []; foreach ($flags as $key => $value) {$array[strtoupper($key)] = $value;} return $array; } private static function _argsToArray($args) { if (preg_match('/^(?:\[.*]|\{.*})$/s', $args)) return json_decode($args, true); return $args; } public function addToQueue($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Delete backup job * * ## OPTIONS * * --id= * : The backup job id to delete * * ## EXAMPLES * * wp jetbackup deleteBackupJob --id=2 * * @when after_wp_load */ public function deleteBackupJob($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Delete destination * * ## OPTIONS * * --id= * : The destination id to delete * * ## EXAMPLES * * wp jetbackup deleteDestination --id=2 * * @when after_wp_load */ public function deleteDestination($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Abort queue item * * ## OPTIONS * * --id= * : The queue item id to delete * * ## EXAMPLES * * wp jetbackup abortQueueItem --id=2 * * @when after_wp_load */ public function abortQueueItem($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Delete backup * * ## OPTIONS * * --id= * : The snapshot id to delete * * ## EXAMPLES * * wp jetbackup deleteSnapshot --id=2 * * @when after_wp_load */ public function deleteSnapshot($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Delete download * * ## OPTIONS * * --id= * : The download id to delete * * ## EXAMPLES * * wp jetbackup deleteSnapshot --id=2 * * @when after_wp_load */ public function deleteDownload($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Enable/Disable export config * * ## OPTIONS * * --id= * : the ID of the destination to configure. * * ## EXAMPLES * * wp jetbackup destinationSetExportConfig --id=2 * * @when after_wp_load */ public function destinationSetExportConfig($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Duplicate backup job * * ## OPTIONS * * --id= * : Job id of the job to duplicate. * * ## EXAMPLES * * wp jetbackup duplicateBackupJob --id=2 * * @when after_wp_load */ public function duplicateBackupJob($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Edit the notes of a backup. * * ## OPTIONS * * --id= * : The id of the backup whose notes you want to edit * * --notes= * : The new notes to associate with the backup * * ## EXAMPLES * * wp jetbackup editBackupNotes --id=2 --notes="test" * * @when after_wp_load */ public function editBackupNotes($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Enable/Disable backup job (Toggle the backup job status: enable to disable or disable to enable with a single action) * * ## OPTIONS * * --id= * : The id of backup job enable/disable * * ## EXAMPLES * * wp jetbackup enableBackupJob --id=2 * * @when after_wp_load */ public function enableBackupJob($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Enable/Disable destination (Toggle the destination status: enable to disable or disable to enable with a single action) * * ## OPTIONS * * --id= * : The id of Destination to enable/disable * * ## EXAMPLES * * wp jetbackup enableDestination --id=2 * * @when after_wp_load */ public function enableDestination($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve a single backup * * ## OPTIONS * * --id= * : The id of the backup to retrieve * * ## EXAMPLES * * wp jetbackup getBackup --id=2 * * @when after_wp_load */ public function getBackup($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve a single backup job * * ## OPTIONS * * --id= * : The id of the backup job to retrieve * * ## EXAMPLES * * wp jetbackup getBackupJob --id=2 * * @when after_wp_load */ public function getBackupJob($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve a single destination * * ## OPTIONS * * --id= * : The id of the destination to retrieve * * ## EXAMPLES * * wp jetbackup getDestination --id=2 * * @when after_wp_load */ public function getDestination($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve a single queue item * * ## OPTIONS * * --id= * : The id of the queue item to retrieve * * ## EXAMPLES * * wp jetbackup getQueueItem --id=2 * * @when after_wp_load */ public function getQueueItem($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve a single schedule * * ## OPTIONS * * --id= * : The id of the schedule to retrieve * * ## EXAMPLES * * wp jetbackup getSchedule --id=2 * * @when after_wp_load */ public function getSchedule($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve log data or full content from a queue item. * * ## OPTIONS * * --queue_item_id= * : The ID of the queue item to fetch the log for. * * --content= * : If set, the actual content of the log file will be returned. * * ## EXAMPLES * * wp jetbackup getLog --queue_item_id=123 --content=0 * wp jetbackup getLog --queue_item_id=123 --content=1 * * @when after_wp_load */ public function getLog($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * List all backup jobs * * ## OPTIONS * * --id= * : The id of the snapshot item to retrieve (Must be homedir snapshot item indexed from JetBackup Linux integration) * * --location= * : The path location to browse (from WP public directory) * * [--limit=] * : limit the result to the specified number (default to 99999) * * [--skip=] * : skip the result to the specified number (default to 0) * * [--sort=] * : sort the result (default to asc) * * ## EXAMPLES * * wp jetbackup listBackupJobs --limit=5 --sort=desc * * @when after_wp_load */ public function fileManager($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve automation settings * * ## EXAMPLES * * wp jetbackup getSettingsAutomation * * @when after_wp_load */ public function getSettingsAutomation($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve general settings * * ## EXAMPLES * * wp jetbackup getSettingsGeneral * * @when after_wp_load */ public function getSettingsGeneral($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve logging settings * * * ## EXAMPLES * * wp jetbackup getSettingsLogging * * @when after_wp_load */ public function getSettingsLogging($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve maintenance settings * * * ## EXAMPLES * * wp jetbackup getSettingsMaintenance * * @when after_wp_load */ public function getSettingsMaintenance($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve notifications settings * * * ## EXAMPLES * * wp jetbackup getSettingsNotifications * * @when after_wp_load */ public function getSettingsNotifications($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve performance settings * * * ## EXAMPLES * * wp jetbackup getSettingsPerformance * * @when after_wp_load */ public function getSettingsPerformance($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve restore settings * * * ## EXAMPLES * * wp jetbackup getSettingsRestore * * @when after_wp_load */ public function getSettingsRestore($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve Integrations settings * * * ## EXAMPLES * * wp jetbackup getSettingsIntegrations * * @when after_wp_load */ public function getSettingsIntegrations($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve security settings * * * ## EXAMPLES * * wp jetbackup getSettingsSecurity * * @when after_wp_load */ public function getSettingsSecurity($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Retrieve updates settings * * * ## EXAMPLES * * wp jetbackup getSettingsUpdates * * @when after_wp_load */ public function getSettingsUpdates($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * List all system alerts * * ## OPTIONS * * [--limit=] * : limit the result to the specified number (default to 99999) * * [--skip=] * : skip the result to the specified number (default to 0) * * [--sort=] * : sort the result (default to asc) * * ## EXAMPLES * * wp jetbackup listAlerts --limit=5 --sort=desc * * @when after_wp_load */ public function listAlerts($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * List all backup jobs * * ## OPTIONS * * [--limit=] * : limit the result to the specified number (default to 99999) * * [--skip=] * : skip the result to the specified number (default to 0) * * [--sort=] * : sort the result (default to asc) * * ## EXAMPLES * * wp jetbackup listBackupJobs --limit=5 --sort=desc * * @when after_wp_load */ public function listBackupJobs($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * List all backups * * ## OPTIONS * * [--limit=] * : limit the result to the specified number (default to 99999) * * [--skip=] * : skip the result to the specified number (default to 0) * * [--sort=] * : sort the result (default to asc) * * ## EXAMPLES * * wp jetbackup listBackups --limit=5 --sort=desc * * @when after_wp_load */ public function listBackups($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * List all destinations * * ## OPTIONS * * [--limit=] * : limit the result to the specified number (default to 99999) * * [--skip=] * : skip the result to the specified number (default to 0) * * [--sort=] * : sort the result (default to asc) * * ## EXAMPLES * * wp jetbackup listDestinations --limit=5 --sort=desc * * @when after_wp_load */ public function listDestinations($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * List available Downloads * * ## OPTIONS * * [--limit=] * : limit the result to the specified number (default to 99999) * * [--skip=] * : skip the result to the specified number (default to 0) * * [--sort=] * : sort the result (default to asc) * * ## EXAMPLES * * wp jetbackup listDownloads --limit=5 --sort=desc * * @when after_wp_load */ public function listDownloads($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * List all queue items * * ## OPTIONS * * [--limit=] * : limit the result to the specified number (default to 99999) * * [--skip=] * : skip the result to the specified number (default to 0) * * [--sort=] * : sort the result (default to asc) * * ## EXAMPLES * * wp jetbackup listQueueItems --limit=5 --sort=desc * * @when after_wp_load */ public function listQueueItems($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * List all schedules * * ## OPTIONS * * [--limit=] * : limit the result to the specified number (default to 99999) * * [--skip=] * : skip the result to the specified number (default to 0) * * [--sort=] * : sort the result (default to asc) * * ## EXAMPLES * * wp jetbackup listSchedules --limit=5 --sort=desc * * @when after_wp_load */ public function listSchedules($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * lock snapshot of a backup * * ## OPTIONS * * --id= * : backup id * * ## EXAMPLES * * wp jetbackup lockSnapshot --id=5 * * @when after_wp_load */ public function lockSnapshot($args, $flags) { self::_command(__FUNCTION__, $args, $flags); } /** * Create or modify backup job * * ## OPTIONS * * [--id=] * : The backup job id to modify. * * [--name=] * : The backup job name. * * [--type=] * : The backup job type (1 for Account, 2 for Config). * * [--backup_contains=] * : The backup contains type (Files backup only = 1,Database backup only = 2, Full backup = 3). * * [--destinations=] * : The backup job destinations (json format) * * [--excludes=] * : Exclude files from backup (json format) * * [--database_excludes=] * : Exclude database tables from backup (json format) * * [--job_monitor=] * : Will notify you if the backup wasn't executed within the specified number of days * * [--schedule_time=