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.
sjoshi
Staff
Staff
Article Id 269159
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:

 

as.PNG

 

 

  • Configure automation stitches on the FortiGate:

 

Automation trigger.

 

From GUI:

1.PNG

 

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:

 

2.PNG

 

 

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

 

In v7.2.4, '%%date%%' and '%%time%%' do not work as expected in an automation stitch. Use '%%log.date%%' and '%%log.time%%' instead.

 

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 a 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:


3.PNG