About this task
The command-line backup and restore tool backs up the same System Configuration and Application Content data as EM does when using task based system.
The executable file name is backuprestore. The following backup and restore tool description provides an overview of the options and the functionality.
Usage:
backuprestore <-b | -r> <filename> -t <taskid> [-ftp server user password destpath [-d]] [-c]
backuprestore <-b | -r> <filename> -t <taskid> [-sftp server user "serverfingerprint"] [-p pass] [-k severkey] [-dp destpath] [-d] [-c]
Backup Examples:
backuprestore -b /backup/SERVICE_DATA_HOSTNAME.zip -t service
backuprestore -b /backup/AMS_CONFIG_DATA_HOSTNAME.zip -t config -ftp ftpserver1 anonymous 1234 /export/home/anonymous/ -d
Restore Example:
backuprestore -r /backup/CONFIG_DATA_HOSTNAME.zip
Important:
Quotation marks must be used if there are spaces in the filenames.
The order of the parameters is important. Follow the earlier examples.
You must include the .zip extension in your filename.
When creating a backup destination using the SFTP protocol, you must use one of the following authentication options:
Backup and Restore tool options |
Option |
Description |
-h |
Display the help message and more examples. |
-b |
Backup indicator followed by the filename to use for the backup. The filename must include the .zip extension. |
-r |
Restore indicator followed by the filename of the file to restore. The file must be an archive with the .zip extension |
-t |
Backup Task type: Defines what will be backed-up: config indicates System Configuration service indicates Application Content. |
-ftp |
Transfer the resulting backup file to an FTP destination. This is optional. |
-sftp |
Transfer the resulting backup file to an SFTP destination. The -sftp switch must be followed by the server address, username and fingerprint of the SFTP destination in quotes. This is optional. For example,
-sftp 10.0.12.23 sftpuser "ecdsa-sha2 nistp256 256 AAAAE2VjZHNhLXNoYTItbmIzdHAyNTYAAAAIbmIzdHAyNTYAAABBBGbVB+kh1TGWdgY+nxgWQSkh+OTDHhuU4eDE6apaoogGUvWTCROw6+vIQfipMbf4WAo2OObAObC+RU9dMX1G+Gc="
The fingerprint field is a combination of three space delimited tokens in the following format: <public key fromat> <key length> <host key text> PuTTY is used to perform the SFTP and supports the following formats for <host key text>:
The MD5 has can be obtained by SSH to the FTP server and issuing the following command. [cust@someserver ~]$ ssh-keyscan localhost
# localhost:22 SSH-2.0-OpenSSH_7.4
localhost ssh-ed25519
AAAAC3NzaC1IZDI1NTE5AAAAIH1w1UO0JWMJGNYnLePhVBP7XI/UjgMKVx1ACHvTIvI
# localhost:22 SSH-2.0-OpenSSH_7.4
localhost ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQCnh9Tz5ZshgaTtz6fPtIZ9Ij7TGSqsPTEa4urhffqw4W3QHvFz1UR8I8OjCVDtDhhqYDqELG5T8mKM/X6q2v0vb5EywB680jEO/RL26YXPPDK3QCN+OeE75+RIwWXPkcKkkZdWHPFvBW3Y6IHEQ9i8GGJPNAMHFVwZ1q3YFmdd/ttlmAtSa//X1mIzARLwPDqSupPk7VhFqdeyu9IqB9Fepay4IHeegxiWEx+mub6J1ko2sswg+D/Aa9CCHKCrBs++tOJnCXTHIW0yIgiuVY35bDyklrgdxaJs6k4XhI8Hwoa6IkxH4hU3rVX2NtDsRPwatzO+gJHOiZLtsrAX7HrB
# localhost:22 SSH-2.0-OpenSSH_7.4
localhost ecdsa-sha2–nistp256
AAAAE2VjZHNhLXNoYTItbmIzdHAyNTYAAAAIbmIzdHAyNTYAAABBBGbVB+kh1TGWdgY+nxgWQSkh+OTDHhuU4eDE6apaoogGUvWTCROw6+vIQfipMbf4WAo2OObAObC+RU9dMX1G+Gc= Using the example above you would configure the following for Secure FTP Remote Server Fingerprint for ecdsa-sha2–nistp256 key type.
ecdsa-sha2–nistp256 256
AAAAE2VjZHNhLXNoYTItbmIzdHAyNTYAAAAIbmIzdHAyNTYAAABBBGbVB+kh1TGWdgY+nxgWQSkh+OTDHhuU4eDE6apaoogGUvWTCROw6+vIQfipMbf4WAo2OObAObC+RU9dMX1G+Gc=
|
-p |
Password for SFTP authentication. Use quotes around passwords containing special characters. Additionally, if the password contains a backslash (\) or a quote (") then each of these characters must be escaped by a preceding backslash (\). This is optional. For example, the password 12;;33\MS"pw should be entered in quotes as follows: "12;;33\\MS\"pw" This is optional. |
-k |
Private key for SFTP server. This is optional. |
-dp |
Destination path for backup on the SFTP server. This is optional. |
-d |
Delete the local file upon successful ftp transfer or restore. This is optional. |
-c |
Direct output that is sent to the console instead of the debug file. This is optional. |