I recently had the need to upgrade the IOS on a Cisco switch (think it was a 3750). As usual, the flash was too small so I needed to remove (and archive/save) the old IOS before putting the new one on. A lot of the images these days include HTML and other things, so are contained in folders rather than a single file. So, how do you take a backup of the image, delete it, and install the new one, without doing each file individually?
It used to be as simple as
copy flash:imagename.bin ftp://10.0.0.2/imagename.bin
Thankfully it’s no more difficult to use the archive functionality, just some new commands to learn.
To archive the files to an FTP server, use:
archive tar /create ftp://10.0.0.2/directoryname.tar flash:directoryname
To delete all of the files, including the directory, use:
delete /force /recursive flash:<directory name>
And to copy it back on to the device, and unarchive it at the same time:
Archive tar /xtract ftp://10.0.0.2/directoryname.tar flash: