Description
This article describes how to send a backup file to an FTP server using automation stitches with the date & time.
Scope
FortiGate.
Solution
The FTP server can be set up using 3CDaemon.
- Go to FTP Server -> Configure FTP server.
- Create a user profile and user directory as below:
- Configure automation stitches on the FortiGate:
Automation trigger.
From GUI:
From CLI:
config system automation-trigger
edit "backup"
set trigger-type scheduled
set trigger-hour 23
set trigger-minute 59
next
end
Automation Action.
From GUI:
From CLI:
config system automation-action
edit "backup"
set action-type cli-script
set script "execute backup config ftp backup_%%date%%.conf 10.5.50.245 salon salon123"
set accprofile "super_admin"
next
end
Note:
Due to the limitation in Windows which does not allow Filenames with special characters ':', the time will not work.
For time-based information, it is necessary to shift to a Linux server.
For both date and time, it is possible to use the below script:
execute backup config ftp backup_%%log.date%%_%%log.time%%.conf 10.5.50.245 salon salon123
Also, note that if the command is directly executed from the CLI of FortiGate, it will not work.
Only through the automation stitches will work.
Output as below:
The line marked with yellow highlight is the backup with date information and the line marked with blue is the backup that will get when the script is directly run from the FortiGate CLI: