Skip to content

Posts

Scheduled backups for Cisco ASA using EEM

Backups for ASA devices can be done several ways. In this post we’ll explore using EEM to create a daily backup and store it on our TFTP server.

The best way to go about this would be to use one of the nicer config management solutions. Absent of those, we can take advantage of some light scripting to accomplish much of the same. I like using the backup command since it gets the certs too. This is essentially a transferable backup that we could then use to completely restore.

config t
event manager applet backupconfig
  event timer absolute time 23:59:59
  action 0 cli command "backup /noconfirm location tftp://192.60.80.7/Backups/FW1/"
  output none
 !
 event manager applet writemem
  event timer absolute time 23:59:00
  action 0 cli command "wr"
  output none

The first applet will run the backup command at exactly midnight and save it to the TFTP. The second does the all-important write memory command, saving the config. You can also save the config as a text file instead of the tar.gz package that the backup command produces. To do that…

event manager applet backupconfig
  event timer absolute time 23:59:59
  action 0 cli command "copy /noconfirm run tftp://192.60.80.7/Backups/FW1/"
  output none