Skip to main content
kdharan
Staff
Staff
Jun 4, 2026 7:49 AM UTC

Encrypted Scheduled Automatic configuration backup

  • Nov 13, 2026 7:31 AM UTC
  • 0 replies
  • 372 views
  • Translate All

Description

 

How to indicate the date in the file name in relation to FortiGate's automatic backup.


Scope

 

FortiGate 7.0, 7.2, 7.4, 7.6.

 

Solution

 

Configure the automation trigger:

 

config system automation-trigger
    edit "backup"
        set trigger-type scheduled
        set trigger-hour 06
        set trigger-minute 00
    next
end

 

Configure automation-action.
Settings to perform backup using 'script’:

 

config system automation-action
    edit "encrypt_backup"
        set action-type cli-script
        set script "execute backup config sftp FGT_backup.conf 10.0.3.225 my-ftp-user userpasword encryptpassword"
        set accprofile "super_admin"
    next
end


 Syntax for FTP server. Use it in an automation-action script:

execute backup config ftp <backup_filename> <ftp_server>[<:ftp_port>] [<user_name>] [<password>] [<encrypt_password>]


Note:

[<backup_password>] is used for encrypting the config file, and it is an optional parameter in the syntax.

 Syntax for TFTP server. Use it in an automation-action script:

execute backup config tftp <encrypt_filename> <tftp_servers> [<backup_password>]

 

Note:

[<backup_password>] is used for encrypting the config file, and it is an optional parameter in the syntax.


Syntax for SFTP server. Use it in an automation-action script:

execute backup config sftp <backup_filename> <sftp_server>[<:sftp_port>] <user> <password> [<encrypt_password>


Note:

In the syntax, [<backup_password>] is used for encrypting the config file, and it is an optional parameter in the syntax.

Configure automation-stitch:


config system automation-stitch
    edit "encrypt_backup_test"
        set status enable
        set trigger "backup"
            config actions
                edit 1
                    set action "encrypt_backup"
                    set required enable
                next
            end
    next
end


Note:

The SFTP credentials used within an Automation Stitch CLI script are stored in plain text. Currently, FortiOS does not provide a supported method to encrypt or hide credentials embedded in these scripts.

As an alternative, we recommend considering:

FortiManager or FortiGate Cloud for automated configuration backups.

An external backup solution that retrieves FortiGate configurations while securely storing credentials outside the firewall.

    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024