Wired Intelligent Edge (Campus Switching and Routing)

New Contributor

Config Backup Filenames

Is there a way to insert the hostname of the switch into the filename of a config backup?

Something like:

(config)# backup startup-configuration to $HOSTNAME$-backup.cfg


The Cisco equivalent would be:


 path tftp://$h-backup.cfg



Also, is there a way to use FTP or anything else instead of TFTP?

MVP Expert

Re: Config Backup Filenames



There is not, at present, a method to use parameters (such as the hostname) in the copy command within the switch CLI.  (This can be done programmatically, however, using the built-in REST API in conjunction with a scripting language or automation platform.)


With regard to using protocols other than TFTP: ArubaOS-Switch also supports SFTP and SCP (the latter of which requires file transfers to be initiated from the management station rather than the switch).  To enable these protocols from the CLI, enable SSH (if not already enabled) and run the following command:


switch(config)# ip ssh filetransfer

This will enable SFTP/SCP and disable TFTP.  You would then use the following syntax to copy files from the switch to an SFTP server:


switch# copy startup-config sftp user@server 

Matt Fern
Senior Technical Marketing Engineer, Aruba Switching

Aruba, a Hewlett Packard Enterprise company

T: 916.540.1759  |  E: mfern@hpe.com   |   Matt @ Twitter
New Contributor

Re: Config Backup Filenames

Hi Matthew,


I did find the "ip ssh filetransfer" command, but that doesn't seem to apply to the "backup" command.


I do have plans to manage switches using the API and ansible - I can easily script in the $hostname functionality I am looking for.  Just the backup command would still use TFTP.  That's OK as I've got a TFTP server running properly (firewalled, etc.) already, but SCP would be a bit more modern.  Sure, I can pull the configs using SCP, but the backup command appeals to me in that it allows the switch to 'push' a backup config every time there's a change.