FortiSwitch
FortiSwitch: secure, simple and scalable Ethernet solutions
Vishnuprasad
Staff
Staff
Article Id 390149
Description The article describes how to take a scheduled backup configuration from a standalone FortiSwitch with the variable names like date, time and serial number using the automation stitches.
Scope Standalone FortiSwitches 7.2.2 and above.
Solution
  1. Configure a trigger with the type 'Schedule'.

 

The following script will be triggered every hour after 1 minute based on the time configured on the FortiSwitch.

 

config system automation-trigger
    edit "Daily"
        set trigger-type scheduled
        set trigger-frequency hourly
        set trigger-minute 1
    next
end


  1. Configure an action with the type 'CLI Script' with the file name including the '%%log.date%%' variable:


config system automation-action
    edit "CreateBackup"
        set action-type cli-script
        set minimum-interval 0
        set script "execute backup full-config tftp Backup%%log.date%%.conf <IP_Address>"
        set accprofile "super_admin"
    next
end

 

  1. Create an automation-stitch, then set the configured trigger and action.

 

config system automation-stitch
    edit "DailyBackup"
        set status enable
        set trigger "Daily"
        set action "CreateBackup"
    next
end


The above automation-stitch configuration will create the backup file with the name 'Backup2025-04-25.conf'.


Note: Checking through the CLI console or SSH will not reflect any changes to the variables. The automation-stitch needs to be used to have the backup configuration with variable names based on the date, time and serial number.