Link Search Menu Expand Document

SqlBak-CLI documentation

encrypt command

This command encrypts the password. This can be useful if you don’t want to explicitly specify the password in the settings file. The password will be encrypted with a symmetric key and output to the console in base64 format.

The password encrypted with this command and specified in a backup job JSON file will be decrypted and used during job execution.

Invocation Syntax

sqlbak-cli encrypt [ARG...]

If no arguments are specified, the command requests a text to encrypt.

Optional arguments


A password that should be encrypted. Use quotation marks to avoid spaces, as well as the characters ‘-‘ and ‘=’.


A path to a file with text that should be decrypted.


Encryption of arbitrary text.

sqlbak-cli encrypt

Text encryption from a specified file.

sqlbak-cli encrypt --file=”c:\password\db-password.txt”

Examples of use in backup job’s settings

In a backup job JSON file, a password is encrypted since it starts with aes:...

        "source": {
                "source_type": "mssql",
                "data_source": ".",
                "trust_server_certificate": true,
                "user_name": "sa",
                "user_password": "*********",
                "backup_items": {
                        "items": [
        "destinations": [{
            "destination_type": "ftp",
            "server_name": "",
            "user_name": "Mike",
            "user_password": "aes:9t6W/x8g5d81X29sspps29IlnUS133s0cZCgMP2kaCq=",
            "path" : "backups"