cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8115
Views
5
Helpful
1
Replies

Information on shorthands and variables in archive comand

GeorgesGiralt
Level 1
Level 1

Hello !

In our switches we use the archive IOS command in order to archive automagically the IOS config onto an FTP server. So fine so good.

The IOS version has been upgraded to 12.2(55) and now the naming of the files have changed :

Previously, in the ftp:// path we used $h.conf for the file name and this file name was appended with the version number automatically.

Now we get the full date-time (up to the second...) with - separating the blocks appended to the file name.

This made for very long names.

Questions :

Is there a way to set "old style" numbering ?

Are there another variables/shorthands (like the $h above) to tailor the path more finely ?

Many thanks in advance for your help !

P.S. : the Cisco web site doesn't give much on the archive command...

1 Reply 1

phiharri
Level 1
Level 1

Greetings Georges,

There isn't any way to omit the timestamp from a config archive path, you can choose the position in the filename with $t variable but if one is not specified it will be appended to the end as of 12.2(50)SE for the 12.2SE train.

$h and $t are the only variables at this time.

Perhaps you could use a script on the FTP server to clean up the filenames, this example replaces anything between a pair of dashes in each filename in the current directory with a single dash:

$ ls -l
-rw-r--r--   1 phiharri cisco           0 Jan 21 18:38 switch1-Apr--12-04-19-44.661-2
-rw-r--r--   1 phiharri cisco           0 Jan 21 18:38 switch1-Apr--8-04-19-44.661-0
-rw-r--r--   1 phiharri cisco           0 Jan 21 18:38 switch1-Apr--9-04-19-44.661-1
$ for f in * ; do mv $f `echo $f | sed 's/-.*-/-/'` ; done
$ ls -l
-rw-r--r--   1 phiharri cisco           0 Jan 21 18:38 switch1-0
-rw-r--r--   1 phiharri cisco           0 Jan 21 18:38 switch1-1
-rw-r--r--   1 phiharri cisco           0 Jan 21 18:38 switch1-2

Hope this helps!

/Phil