The backup_restore_manager Script

Valid for versions 82 through the latest version

Version:

82

Last modified: July 28, 2022


Overview

The /usr/local/cpanel/bin/backup_restore_manager script manages the backup restoration queue. You can use this script to add or remove users from the queue.

This script also lets you:

  • View which cPanel account backups the system is restoring.
  • Display the current state of the backup restoration process.
  • Remove finished backup restorations from the queue.

Run the script

To run this script on the command line, use the following format:

/usr/local/cpanel/bin/backup_restore_manager [options]

Options

The script accepts the following options, depending the chosen operation:

Add an account to the queue

Use the following options with this script when adding a cPanel account to the backup restoration queue:

Option Description Example
user Required.
The cPanel account’s username.
user=username
add Required.
Add an account to the queue.
add
restore_point Required.
Queue the account’s backup restoration for a specific date, in YYYY-MM-DD format.
restore_point=2021-01-25
destid The backup source’s destination ID. This option defaults to local. destid=0BRL4p7lZnfoCsaH8xj6821P
give_ip Assign the account a dedicated IP address during the backup restoration process.
  • 1 — Assign a dedicated IP address.
  • 0 — Do not assign a dedicated IP address.
This option defaults to 0.
give_ip=1
mail_config Restores the account’s email configuration that appear in the account’s backup file.
  • 1 — Restore the account’s email configuration.
  • 0 — Do not restore the account’s email configuration.
This option defaults to 0.
mail_config=1
mysql Restore the account’s MySQL® databases that appear in the account’s backup file.
  • 1 — Restore the account’s MySQL databases.
  • 0 — Do not restore the account’s MySQL databases.
This option defaults to 0.
mysql=1
subdomains Restores any subdomains that appear in the account’s backup file.
  • 1 — Restore the account’s subdomains.
  • 0 — Do not restore the account’s subdomains.
This option defaults to 0.
subdomains=1

Remove an account from the queue

Use the following options with this script when deleting a cPanel account from the backup restoration queue:

Option Description Example
user Required.
The cPanel account’s username.
user=username
delete Required.
Remove the account from the queue.
delete
delete_finished Remove the account from the completed queue. delete_finished
start_time The time at which to remove the account from the completed queue, in Epoch Unix Time format.
Important:
You must use this option with the delete_finished option.
start_time=1611595457

Additional options

Use the following options with this script:

Option Description Example
activate Process the current pending queue. activate
delete_all_failed Delete all failed entries in the completed queue. delete_all_failed
delete_all_finished Delete all entries in the completed queue. delete_all_finished
delete_all_pending Delete all entries in the pending queue. delete_all_pending
delete_all_regardless Delete all entries in the pending, active, and completed queues, regardless of their status. delete_all_regardless
is_active Display if the restoration process currently in progress. is_active
list Display all entries in the backup restoration queue. list
list_active Display all backup restorations currently in progress. list_active
list_finished Display all completed backup restorations. list_finished
state Display the queue status of all backup restorations (pending, active, and completed) and whether the system finished the process (start or end). state

Examples

Add an account to the backup restoration queue with a destination ID and include the backup file’s MySQL, email configuration, and subdomain settings:

/usr/local/cpanel/bin/backup_restore_manager add user=username restore_point=2021-01-25 destid=0BRL4p7lZnfoCsaH8xj6821P mysql=1 mail_config=1 subdomains=1

Display all entries in the queue:

1
/usr/local/cpanel/bin/backup_restore_manager list
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
======[ username ]==============================
destid = 0BRL4p7lZnfoCsaH8xj6821P
give_ip = 0
mail_config = 1
mysql = 1
subdomains = 1
restore_point = 2021-01-25

result = 1
reason = OK

Display the current state of the backup restoration queue:

1
/usr/local/cpanel/bin/backup_restore_manager state
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
is_active=0
start [pending]

======[ username ]==============================
destid = 0BRL4p7lZnfoCsaH8xj6821P
give_ip = 0
mail_config = 0
mysql = 0
subdomains = 0
restore_point = 2021-01-25

end [pending]

start [completed]

end [completed]

start [active]

end [active]

result = 1
reason = OK

Delete an account from the completed queue:

/usr/local/cpanel/bin/backup_restore_manager delete_finished user=username start_time=1611619200

Additional Documentation