cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
454
Views
0
Helpful
1
Replies

Backup Startup Config EMM

hs08
VIP
VIP

Hello,

How we can make EEM Script to backup startup config to the SCP server with 2 condition :

  1. Backup when we issue write memory command
  2. Backup weekly every sunday @10PM
1 Accepted Solution

Accepted Solutions

M02@rt37
VIP
VIP

Hello @hs08 

To handle both conditions properly—one triggered by write memory and one for the weekly backup at 10 PM on Sundays—you will need two separate EEM applets. Unfortunately, there's no way to have two distinct triggers (events) in a single applet, as EEM supports only one event statement per applet.

event manager applet BACKUP_ON_WRITE_MEMORY
description "Backup startup-config to SCP when 'write memory' is issued"
event cli pattern "write memory" sync yes
action 1.0 cli command "enable"
action 1.1 cli command "copy startup-config scp://username:password@<scp-server-ip>/backup-write-memory-config.cfg"
action 1.2 syslog msg "Configuration backup completed after write memory."

---

event manager applet WEEKLY_BACKUP
description "Backup startup-config to SCP every Sunday at 10 PM"
event timer cron cron-entry "0 22 * * 0"
action 1.0 cli command "enable"
action 1.1 cli command "copy startup-config scp://username:password@<scp-server-ip>/weekly-backup-config.cfg"
action 1.2 syslog msg "Weekly configuration backup completed."

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

View solution in original post

1 Reply 1

M02@rt37
VIP
VIP

Hello @hs08 

To handle both conditions properly—one triggered by write memory and one for the weekly backup at 10 PM on Sundays—you will need two separate EEM applets. Unfortunately, there's no way to have two distinct triggers (events) in a single applet, as EEM supports only one event statement per applet.

event manager applet BACKUP_ON_WRITE_MEMORY
description "Backup startup-config to SCP when 'write memory' is issued"
event cli pattern "write memory" sync yes
action 1.0 cli command "enable"
action 1.1 cli command "copy startup-config scp://username:password@<scp-server-ip>/backup-write-memory-config.cfg"
action 1.2 syslog msg "Configuration backup completed after write memory."

---

event manager applet WEEKLY_BACKUP
description "Backup startup-config to SCP every Sunday at 10 PM"
event timer cron cron-entry "0 22 * * 0"
action 1.0 cli command "enable"
action 1.1 cli command "copy startup-config scp://username:password@<scp-server-ip>/weekly-backup-config.cfg"
action 1.2 syslog msg "Weekly configuration backup completed."

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.