FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
sgiannogloudis
Description This article describes how to configure the automation stitch settings on how to generate configuration files with different names based on the date on which the script is getting triggered.
Scope FortiGate v6.4.9+ & v7.0.2+GA releases.
Solution

1) Create a trigger with the type 'Schedule'.

 

The below script will be triggered daily at 20:00 pm [FGT's time]

 

# config system automation-trigger
    edit "TFTP_Backup_Daily"
      set trigger-type scheduled
      set trigger-frequency daily
      set trigger-hour 20

         next
  end

 

2) Create action 'CLI Script' where %%date%% variable is utilized:

 

# config system automation-action

edit "backup_date"

set action-type cli-script

set script "execute backup config tftp         Μy_Config_Name%%date%%.conf IP_Address Username Password"

set accprofile "super_admin"

next

end

 

3) Create a stitch:

 

# config system automation-stitch

edit "date_test"

set trigger "TFTP_Backup_Daily"

config actions

edit 1

set action "backup_date"

set required enable

next

end

end

 

4) Then, on the TFTP server configuration backup files will look like this:

 

Μy_Config_Name2022-08-19
Μy_Config_Name2022-08-20
Μy_Config_Name2022-08-21
Μy_Config_Name2022-08-22