The configuration looks fine. How are you testing the configuration? Please use "Test automation stitch" option from "stitch" tab /right click on stitch. If you directly run the command on CLI, it won't have the event date/time parameters and the file name will be what you see now.
If the FTP server is windows based, then we cannot use "%%time%%" as windows don't allow file name with ":". date and time works fine with linux based FTP server.
- Have you found a solution? Then give your helper a "Kudos" and mark the solution.
config system automation-action
edit "automation script"
set action-type cli-script
set minimum-interval 0
set delay 0
set required enable
set script "execute backup config ftp /net-devices-auto-bkp-to-g-drive/bkp-%%hostname%%-%%date%%_%%time%%.conf FTP-Server FTP-user FTP-user-pwd"
config system automation-trigger
set trigger-type scheduled
set trigger-frequency daily
set trigger-hour 5
set trigger-minute 5
config system automation-stitch
set status enable
set trigger "test"
set action "automation script"
System Info is:
# get system status
Version: FortiGate-100E v6.2.3,build1066,191218 (GA)
# execute date
current date is: 2023-06-07
# execute time
current time is: 05:56:32
last ntp sync:Fri Mar 31 11:06:42 2023
The backup file that gets stored in FTP server is :
Hence, the hostname, date and time are not at all substituted by actual values
I tested on firmware 7.4 and 7.2.5 to automate to send to ftp is working for %%date%% but if add the time script %%time%% , it failed. I using filezilla server on Win Server. The action I had set is using the CLI Script.
CLI Script /fgt-%%date%%-%%time%%_config.conf
The message stated in the ftp server: Server Log STOR fgt-2023-09-20-16:25:00_backup.conf 550 Invalid file name or path
CLI Script /fgt-%%date%%_config.conf
The message stated in the ftp server: Server Log STOR fgt-2023-09-20_backup.conf 150 150 Starting data transfer 226 operation successful
I suspect is the semi-colon cause it on the file name. Does anyone know if there is any possible to add a cli script like a counter CLI?
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.