Hello everyone,
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 :
(DD-MM-YYYY)
24032021-backup.conf
23032021-backup.conf
22032021-backup.conf
............
After my research I haven't found anyway to do that (at least using CLI), any ideas ?
Have a nice day,
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.
It's funny because i'm currently doing the exact same thing, it's a bit of a workaround but it does the job :) I'll update this post if I find anything more straightforward.
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.
Ken Felix
PCNSE
NSE
StrongSwan
Hello,
is here some new Information about this ?
Search vor this option too, safe Config External by sftp, but its overwrites daily.
execute backup config ftp /Backups/fortigate/backup_%date%.cfg 192.168.1.232 fortigate pw
cya
Frank
Thanks
Kangming
tip: you can set the scp download file name during the scp to save on a step of renaming the file
scp -P 2022 kfelix@192.168.1.99:sys_config ./file.`date +%Y_%m_%d_%H_%M_%S`.conf http://socpuppet.blogspot.com/2015/10/fortigate-configuration-files-backups.html Ken Felix
PCNSE
NSE
StrongSwan
emnoc wrote:tip: you can set the scp download file name during the scp to save on a step of renaming the file
scp -P 2022 kfelix@192.168.1.99:sys_config ./file.`date +%Y_%m_%d_%H_%M_%S`.conf http://socpuppet.blogspot.com/2015/10/fortigate-configuration-files-backups.html Ken Felix
Yes, it's better.
Thank you for sharing, I'd like to study Linux Shell well, this is very useful!
Thanks
Kangming
create automation backup to Windows server
exec backup full-config ftp backup/forti-full-config.conf 192.168.20.248:2021 username password
then create script command shell, save this script file type .bat
@echoOFF
:PREPARE DATE STAMP
SET YEAR=%date:~6,4%
SET MONTH=%date:~3,2%
SET DAY=%date:~0,2%
D:
cd backup\forti\backup
REN forti-full-config.conf %YEAR%%MONTH%%DAY%-forti-full-config.conf
create new task schedule and done.
can also be applied on a linux server with shell script
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1740 | |
1108 | |
752 | |
447 | |
240 |
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.
Copyright 2024 Fortinet, Inc. All Rights Reserved.