Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
shspivey
New Contributor II

Add Time Stamp to Automated Backup

I have added an automation feature to automatically back up my FortiGate firewalls every night. I would like to include a time stamp in the file name but so far I have not been able to get that to work. This is the filename I am assigning through the execute backup script: daily-backup_%%log.devname%%_%%log.date%%_%%log.time%%.conf

 

The variable %%log.time%% does not work. If that variable is included in the script my filename looks something like this, 1WSIAF~2, with no file extension or any of the other file name elements. I have tried to use %%time%% but that does not work either.

 

Is adding a time stamp through this script impossible?

SHS
SHS
2 REPLIES 2
shspivey
New Contributor II

I may have answered my own question. I continued to test and decided to send the log file to myself in an email so I could see all of the data included. The log file does in fact have a time element included, but the format is in military time with colons - 19:25:58. Since a colon is not an allowed character for a Windows filename, I believe that is what's causing the problem.

 

I wonder if I can have the time stamp formatted differently in that log file?

SHS
SHS
ametkola
Staff
Staff

Hello shspivey,

 

You can try to add a date at your filename as per below and let me know if this helps.

 

execute backup config sftp /fgt-backup%%date%%.conf 1.1.1.1 sftp-username sftp-password encryption-password

 

Regards,

Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors