Cisco ASA Series Cli Configuration Manual page 2080

Software version 9.0 for the services module
Hide thumbs Also See for ASA Series:
Table of Contents

Advertisement

Backing Up Configurations or Other Files
Sample Script
#!/usr/bin/perl
#Function: Backup/restore configuration/extensions to/from a TFTP server.
#Description: The objective of this script is to show how to back up
configurations/extensions before the backup/restore command is developed.
# It currently backs up the running configuration, all extensions imported via "import
webvpn" command, the CSD configuration XML file, and the DAP configuration XML file.
#Requirements: Perl with Expect, SSH to the ASA, and a TFTP server.
#Usage: backupasa -option option_value
#
#
#
#
#
#
#
during backup.
#If you don't enter an option, the script will prompt for it prior to backup.
#
#Make sure that you can SSH to the ASA.
use Expect;
use Getopt::Std;
#global variables
%options=();
$restore = 0; #does backup by default
$restore_file = '';
$asa = '';
$storage = '';
$user = '';
$password = '';
$enable = '';
$prompt = '';
$date = `date +%F';
chop($date);
my $exp = new Expect();
getopts("h:u:p:w:e:s:r:",\%options);
do process_options();
do login($exp);
do enable($exp);
if ($restore) {
do restore($exp,$restore_file);
}
else {
$restore_file = "$prompt-restore-$date.cli";
open(OUT,">$restore_file") or die "Can't open $restore_file\n";
do running_config($exp);
do lang_trans($exp);
do customization($exp);
do plugin($exp);
do url_list($exp);
do webcontent($exp);
do dap($exp);
do csd($exp);
close(OUT);
}
do finish($exp);
sub enable {
Cisco ASA Series CLI Configuration Guide
1-20
-h: ASA hostname or IP address
-u: User name to log in via SSH
-w: Password to log in via SSH
-e: The Enable password on the security appliance
-p: Global configuration mode prompt
-s: Host name or IP address of the TFTP server to store the configurations
-r: Restore with an argument that specifies the file name. This file is produced
Chapter 1
Managing Software and Configurations

Advertisement

Table of Contents
loading

Table of Contents