I would like to setup an automated backup of the config of my Fortigate 100E to an FTP server, I know that this is easily feasible and i've already done it but I would like not to erase each config backup after it's done for conservation purposes. My idea would be to put the date of the backup in the filename of the backup automaticly so the directory where it goes looks like that :
After my research I haven't found anyway to do that (at least using CLI), any ideas ?
If you figure it out from the FortiSide, let me know. What we did was run a Powershell script against the FTP server to change the filename daily so the FGT pushes the file and then about 30 minutes later the script runs to rename it based on the date. That way the next FGT push doesn't overwrite it.
You should look at the fortios API you can do that with ease imho. I prefer scp-copy and that works flawlessly and you can set the name of the filename when you copy it. Search here for exampes with power-shell or bash scripting.
Technical Tip: How to download a FortiGate configuration file and upload firmware file using secure ...
root@pc1:/home/test/Desktop# scp email@example.com:sys_config /home/test/Desktop
sys_config 100% 597KB 596.6KB/s 00:00
1 iperf2.txt iperf.txt Old Firefox Data sys_config
root@pc1:/home/test/Desktop# mv sys_config fgt_sys_config.`date +%Y_%m_%d_%H_%M_%S`.conf
1 fgt_sys_config.2021_09_02_11_17_34.conf iperf2.txt iperf.txt Old Firefox Data
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.