20. Backup Tasks/Commands¶
20.1. backup
¶
backup
exports files and all configuration objects from one or multiple domains.
The function provided by this task is equivalent to that of the “Create a backup of the entire system” or “Create a backup of one or more application domain” options in the “Export configuration” function of WebGUI.
backup
does not export user accounts, certificates or keys. Use secure backup if you need to include certificates and keys.
The backups are saved as zip files on the local file system.
Note that, unlike export, you can restore the output of backup
only into the domain the backup was taken from.
backup
only backs up the files located in the “local:/” filesystem.
Use backup
when you need to export/backup multiple domains. In most other cases, the export
command/task is preferable, since it provides more flexibility.
20.1.1. Attributes/Options¶
Name | Description | Required |
---|---|---|
file | Name of the zip file where the backups should be saved. The resulting zip file will contains individual zip files for each domain. The task will create directories to save the file to if they don’t exist. |
Yes |
appendTimestamp | If true, automatically append timestamp to the file name. The timestamp has the format Defaults to |
No |
domainPatterns | Comma-delimited list of regular expression patterns defining which domains to back up. To backup all domains simply use ”.*”. Use Defaults to current domain. The current domain is specified using the |
No |
persisted | If set to Defaults to |
No |
deploymentPolicyFile | Path to the deployment policy file on the local filesystem. The deployment policy is automatically uploaded/configured on the device before the request is executed. The deployment policy will be embedded with the export file. |
No |
deploymentPolicyName | Name of the deployment policy to include with the export/backup. The policy has to already be defined on the device. | No |
20.1.2. domainPattern
Nested Element¶
domainPattern
provides an alternative to specifying domain patterns in the domainPatterns
attribute. It is useful when a regular expression pattern contains commas, which are used as a delimiter in the domainPatterns
attribute.
You can specify multiple domainPattern
elements within the same task.
Attribute | Description | Required |
---|---|---|
pattern | Backup domains matching this regexp pattern. | Yes |
20.1.3. Examples¶
The following example backs up all domains with the name starting with “dev”. The timestamp will be automatically added to the file name.
dpbuddy backup -file backups/backup.zip -domainPatterns "dev.*" -appendTimestamp
<dp:backup file="backups/backup.zip" domainPatterns="dev.*" appendTimestamp="true" />
20.2. secureBackup
¶
This task performs secure backup of the device. Unlike regular backup, secure backup includes certificates, keys and user passwords. You can find more details about secure backups in InfoCenter or in this developerWorks article.
secureBackup
first creates secure backup files on the appliance, then automatically downloads all the files to a local directory, specified using the toDir
attribute. Creating backup files may take several minutes, depending on the size of your file systems.
Secure backups are always performed in the default domain.
Note that secure backup files may be quite large. DPBuddy always streams downloaded files directly to disk, so it is able to download files of any size. However, DataPower may not be able to stream files, so it may take a few minutes to prepare the file on the device (DataPower has to encode the file using base64 encoding) before the downloading can begin.
You can run secureBackup
with the environment prefix list so that you can make a backup of multiple devices in a single command. In this case, you may want to append the host name of your DataPower device to the directory where the backup is saved. You will need to escape the dollar sign with backslash on Linux. Also, dp.url can contain only the host name.
dpbuddy secureBackup -cert crypto-backup-test -toDir "sbackup_\${dp.url}" -appendTimestamp -env "device1,device2"
20.2.1. Attributes/Options¶
Name | Description | Required |
---|---|---|
cert | Name of the crypto certificate containing the public key used to encrypt the secure backup. You must create the crypto certificate before using this task. The crypto certificate can be created from WebGUI by navigating to Objects/Crypto Configuration/Crypto Certificate. | Yes |
toDir | Local directory where the backup files should be saved. The directory will be created if it doesn’t exist. | Yes |
appendTimestamp | If true, automatically append timestamp to the directory name specified in Defaults to |
No |
includeISCSI | If set to Defaults to |
No |
includeRAID | If set to Defaults to |
No |
dpDir | DataPower directory for storing secure backup files. This could be any temporary directory. Defaults to |
No |
20.2.2. Examples¶
Create secure backup and download the backup files to “sbackups/${dp.host}/backup”. DPBuddy will add timestamp to the “backup” directory.
You can use -env
or dp.env
property to run the backup against multiple devices.
dpbuddy secureBackup -cert crypto-backup-test -toDir "sbackups/${dp.host}/backup" -appendTimestamp -env="device1, device2"
<dp:secureBackup cert="crypto-backup-test" toDir="sbackups/${dp.host}/backup"
includeISCSI="false" includeRAID="false" appendTimestamp="true" />