Enhance automation trigger to execute only once at a scheduled date and time 7.2.1
The Schedule automation trigger has been updated to allow one-time triggers that occur only once at a specified date and time. This trigger can be used to support one-time automation actions, including one-time configuration backup to a disk, a reboot, or a shutdown.
config system automation-trigger edit <name> set trigger-type scheduled set trigger-frequency once set trigger-datetime <YYYY-MM-DD HH:MM:SS> next end
Example
In this example, an automation stitch is created to trigger a one-time configuration backup to a disk. The backup will occur August 5, 2022 at 4:00 AM.
To schedule a one-time automation stitch in the GUI:
-
Configure the trigger:
-
Go to Security Fabric > Automation, select the Trigger tab, and click Create New.
-
In the Miscellaneous section, click Schedule.
-
Enter a name (schedule-once) in the Name field.
-
In the Frequency dropdown list, select Once.
-
Select when the trigger will occur in the Date/Time fields.
-
Click OK.
-
-
Configure the action:
-
Go to Security Fabric > Automation, select the Action tab, and click Create New.
-
In the General section, click System Action.
-
Enter a name (Backup config disk) and an action description.
-
In the Action dropdown list, select Backup configuration.
-
Click OK.
-
-
Configure the stitch:
-
Go to Security Fabric > Automation, select the Stitch tab, and click Create New.
-
Enter the name, backup-once.
-
Click Add Trigger. Select schedule-once and click Apply.
-
Click Add Action. Select Backup config disk and click Apply.
-
Click OK. The backup configuration will occur once at the date and time you set.
-
To schedule a one-time automation stitch in the CLI:
-
Configure the trigger:
config system automation-trigger edit "schedule-once" set trigger-type scheduled set trigger-frequency once set trigger-datetime 2022-08-05 04:00:00 next end
-
Configure the action:
config system automation-action edit "Backup config disk" set description "Default automation action configuration for backing up the configuration on disk." set action-type system-actions set system-action backup-config next end
-
Configure the stitch:
config system automation-stitch edit "backup-once" set trigger "schedule-once" config actions edit 1 set action "Backup config disk" set required enable next end next end
-
To view automation stitch information:
# diagnose test application autod 3 stitch: backup-once (scheduled) local hit: 0 relayed to: 0 relayed from: 0 last trigger: last relay: next scheduled trigger:Fri Aug 5 05:00:00 2022 actions: backup config disk: done: 0 relayed to: 0 relayed from: 0 last trigger: last relay: logid to stitch mapping: id:0 (scheduled stitches) local hit: 0 relayed hits: 0 backup-once