Hone

Lessons · Network switches · copy, source first

copy FROM TO, and there are no exceptions

Every `copy` on a switch reads the first argument and writes the second. Source first, destination second, everywhere in IOS.

Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.

What it is for

Both directions are valid commands, so nothing stops you getting it backwards -- and backwards is either your only backup overwritten, or a file pushed onto a live switch on top of what is running.

How to think about it

Read it left to right, out loud if it helps. running-config to startup-config saves. tftp to running-config restores. The rule is the whole trick.

Worked example

enable
In.
configure terminal
Something to save.
hostname IDF3
Named.
end
Out.
copy running-config startup-config
From the live one, to the one that boots. This saves.
copy running-config tftp://10.0.0.9/idf3.cfg
From the live one, to a server. This backs up.
copy startup-config running-config
The other way round: from the saved one, ONTO the live one. This loads.

Your turn

Save the live configuration so it survives a power cut.

copy running-config 

The trap

There is no confirmation that asks whether you meant it. The command is valid in both directions and runs either way.

Practise copy, source first on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.