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.
ssanga
Staff & Editor
Staff & Editor
Article Id 363323
Description This article describes an issue where FortiGate fails to perform backup configuration when the hostname or backup filename includes the variable '%%log.time%%'.
Scope FortiGate v7.4.4, v7.4.5.
Solution

When using an automation stitch to perform configuration backups with the variable '%%log.time%%', which is intended to include the timestamp in the filename, the backup fails due to unsupported special characters:

execute backup full-config usb MV-FW-Z3-fullconfig-USB-daily-%%log.time%%.txt<----- Using log.time.

__cli_script_close()-121: cli script:
autod.16
output:
########## script name: autod.16, offset: 389##########
========= 1, 2024-10-29 08:19:36 ==========
FortiGate-60F execute backup full-config usb MV-FW-Z3-fullconfig-USB-daily-08:19:29.txt <----- Time parsed correctly.
Please wait...

Copy config MV-FW-Z3-fullconfig-USB-daily-08:19:29.txt to USB disk ...
Copy config file to USB disk failed. <----- Copy fails.
Command fail. Return code 1


However, the backup configuration is successful with the variable '%%log.date%%':

 

execute backup full-config usb MV-FW-Z3-fullconfig-USB-daily-%%log.date%%.txt<----- Using only log.date.

pid:225-__handle_msg()-414: Subscriber:4 received package. pubid:0 pkgid:178 pkg_index:191
pid:225-__handle_pkg_logs()-356: Subscriber:4 processing package size:948 logs:2 pickup:2
pid:225-__subscr_close_cur_pkg()-140: close package size:948 logs:2
__cli_script_close()-121: cli script:
autod.15
output:
########## script name: autod.15, offset: 361##########
========= 1, 2024-10-29 08:19:31 ==========
FortiGate-60F execute backup full-config usb MV-FW-Z3-fullconfig-USB-daily-2024-10-29.txt <----- Date is parsed correctly.
Please wait...

Copy config MV-FW-Z3-fullconfig-USB-daily-2024-10-29.txt to USB disk ...
Copy config file to USB disk OK. <----- Written to USB correctly, and is also visible in the USB drive.

Starting from v7.6.1, the variable '%%log.eventtime%%' has been introduced in place of '%%log.time%%', allowing the inclusion of the Unix timestamp in the filename without using unsupported special characters.

Logs required by FortiGate TAC for investigation.

  1. Debugs:


diagnose debug application autod -1
diagnose debug console timestamp enable
diagnose debug enable
<reproduce the issue>
diagnose debug reset

  1. TAC Report:


execute tac report

 

  1. Configuration file of the FortiGate.
Contributors