Network Management

New Contributor

Backup flash file system configuration files on Aruba Wireless Controller using python

I recently needed to develop an automated method for backing up an aruba wireless controller without using airwave. In tackling this challenege I developed a python script that connects to the controller using ssh, inititaes a flash file system backup, and then copies the file off the controller to a ftp server.


Code is below:


from netmiko import ConnectHandler

# Create device dictionary
wlc01 = {
    'device_type': 'aruba_os',
    'ip': '',
    'username': 'admin',

# Establish secure session to device
net_connect = ConnectHandler(**wlc01)

# Send command to create backup file and wait 2 seconds for backup to complete
net_connect.send_command('backup flash', delay_factor=2)

# Send command to copy backup file to backup server via ftp
cmd1 = 'copy flash: flashbackup.tar.gz ftp: ftpusername /backups flashbackup.tar.gz'
output = net_connect.send_command_timing(cmd1)
if 'Password:' in output:
    output += net_connect.send_command_timing('ftpuserpassword')

#  Disconnect secure session from device


Search Airheads
Showing results for 
Search instead for 
Did you mean: