Hot!Dynamic name for auto backup, possible?

Author
anteopta
New Member
  • Total Posts : 7
  • Scores: 0
  • Reward points: 0
  • Joined: 2020/09/18 02:05:52
  • Status: offline
2020/09/18 02:35:51 (permalink)
0

Dynamic name for auto backup, possible?

I want to make automatic backups and send them over ftp with an auto-script.
is it possible to add the date it was made, so the date at which the script is called, to the name of the backup?
 
the action parameters also didn't help. since they are refering to the previous action, I thought if i use execute date, before the backup, i would be able to get it's output through them. either I don't understand how they work or something with them is wrong. the %%results%% parameter works but %%results.source%%, or anything that calls a parameter within a parameter, does not work. I tried using it in the backup report i send to myselfe per mail.
being able to get the hostname would also be nice then i can just copy the comand without having to change anything.
post edited by anteopta - 2020/09/22 03:41:32
#1

2 Replies Related Threads

    anteopta
    New Member
    • Total Posts : 7
    • Scores: 0
    • Reward points: 0
    • Joined: 2020/09/18 02:05:52
    • Status: offline
    Re: Dynamic name for auto backup, possible? 2020/09/29 05:25:14 (permalink)
    0
    i found out that if the trigger is "configuration change" you can use %%log.date%% to add the date but that only solves it for automaticly making a backup when the config changes not for one that is triggered by a schedule.
    #2
    anteopta
    New Member
    • Total Posts : 7
    • Scores: 0
    • Reward points: 0
    • Joined: 2020/09/18 02:05:52
    • Status: offline
    Re: Dynamic name for auto backup, possible? 2020/10/07 02:54:05 (permalink)
    0
    based on the findings with the log in case of activation on server event, i found a workaround to add the date to the backupfile name.
    but for it to work there can't be any other auto-script that needs to be triggered manualy.
    first you need to make an auto-script that does something, doesn't matter what. (I just have it execute date) it is importend that the start is manual. The config for it would look something like this:
     
    config system auto-script
      edit auto-backup-starter
        set interval 1
        set repeat 1
        set start manual
        set script "execute date"
        next
      end
     
    after that you make an automation that triggers on schedule (this schedule decides when and how regulary your backup triggers) that starts the auto-script that you just created. the script would be "execute auto-script start <name of your auto-script>"
    then set your backup automation to trigger on system event: auto-script start. from that you can use %%log.date%% to get the date for the filename.
     
    the main problem with this method is that you can't have any other auto-scripts that triggers the event auto-script start. note: the event only appers if the script is started with execute auto-script start, meaning if you have a auto-script that is on repeat 0 = infinite it does not interfere with this setup. if you want to make a new auto-script after you set this up, you should disable the backup automation befor starting it. otherwise you will trigger a backup.
     
    i have not found a way to include the Hostname yet.
     
    let's see if someone can find the from forti intended way. I would love to know how they thought to do this as this is a workaround that can trigger for reasons other then the intended. if the schedule trigger would produce a log with date and time all of this wouldn't be necessary.
    post edited by anteopta - 2020/10/07 05:05:05
    #3
    Jump to:
    © 2020 APG vNext Commercial Version 5.5