- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Labels:
-
FortiGate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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,
