.. index:: Backup Tasks
.. _backup_tasks:
Backup Tasks/Commands
=====================
.. _backup:
``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 of 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 :ref:`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, ``export`` command/task should be preferred as it provides more flexibility.
Attributes/Options
^^^^^^^^^^^^^^^^^^
.. list-table ::
:widths: 20 80 8
:header-rows: 1
* - 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 ``yyyyMMdd_HHmmss``.
Defaults to ``false``.
- No
* - domainPatterns
- Comma-delimited list of regular expression patterns defining which domains to back up.
To backup all domains simply use ".*".
Use ``domainPattern`` nested elements if there is a need to use commas inside the regexp.
Defaults to current domain. The current domain is specified using the ``dp.comain`` property or ``domain`` attribute of the task.
- No
* - persisted
- If set to ``true``, backup only the persisted domain configuration.
Defaults to ``false``.
- 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
``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.
.. list-table ::
:widths: 20 80 8
:header-rows: 1
* - Attribute
- Description
- Required
* - pattern
- Backup domains matching this regexp pattern.
- Yes
Examples
^^^^^^^^
The following example backs up all domains with the name starting with "dev". The timestamp will be automatically added to the file name.
.. code-block:: bat
dpbuddy backup -file backups/backup.zip -domainPatterns "dev.*" -appendTimestamp
.. code-block:: xml
.. _secureBackup:
``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 and 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 filesystems.
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 (it has to encode the file using base64 encoding) before downloading can begin.
Attributes/Options
^^^^^^^^^^^^^^^^^^
.. list-table ::
:widths: 20 80 8
:header-rows: 1
* - 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 ``toDir``. The timestamp has the format ``yyyyMMdd_HHmmss``.
Defaults to ``false``.
- No
* - includeISCSI
- If set to ``true``, the iSCSI device will be included in the backup.
Defaults to ``true`` (DataPower default).
- No
* - includeRAID
- If set to ``true``, the RAID device will be included in the backup.
Defaults to ``true`` (DataPower default).
- No
* - dpDir
- DataPower directory for storing secure backup files. This could be any temporary directory.
Defaults to ``temporary:/secure-backup``.
- No
Examples
^^^^^^^^
Create secure backup and download the backup files to "testfiles/sbackup":
.. code-block:: bat
dpbuddy secureBackup -cert crypto-backup-test -toDir testfiles/sbackup -appendTimestamp -dpDir "temporary:/secure-backup"
.. code-block:: xml