Archive and Restore your Cisco Configs
If you are used to typing "wr" to backup your configs, Cisco has been working hard at making it less easy to backup your configuration to flash. For years I've heard that write memory is "going away" and that everyone should use "copy running-config startup-config". If you are working on some newer platforms (NX-OS), you might find that wr doesn't work unless you create an alias:
alias exec wr copy run start
But there are cooler ways to backup your configurations now (aside from using third party tools), such as the Archive feature.
To backup your configs using Archive, here's a script to backup your config to disk0 once a day for two weeks:
Router(config)# archive Router(config-archive)# path disk0:backupconfig Router(config-archive)# maximum 14 Router(config-archive)# time-period 1440
If something happens to the config and you want to roll back to yesterday, that's where configure replace comes in:
Router# configure replace disk0:backupconfig-1 list time 30 Router# configure confirm
You can rollback to a specified file on your router, the "time 30" is a fail safe that will undo the rollback in 30 seconds and return you to the previous state if something goes wrong. Typing configure confirm within that time limit will keep the change.
One last thing, if you want see the last X number of commands typed on a device, Jeremy wrote a cool how to a while back. Here's a link: Configuration Change Tracking...Built in?!?
And for more detailed info on the archive and replace commands, here's a link to Cisco's official doc.

Comments
Very good tip. :)
Very good tip. :)
better solution:
better backup the config to an FTP server or even better scp to a server to backup the configuration.
if the device is lost,stolen, burnt,the CF is defect...anyway, the local flash is not accessible anymore, you have a backup elsewhere and yue are able to configure a new box.
Great point Robert. Take the
Great point Robert. Take the example and modify it to meet your organization's needs in whatever way works best. If you have a central server to copy the files to, then I completely agree that sending the file to a server is a good idea.
As with many features, there are pros and cons. Storing the files remotely definitely has the advantage of saving you from theft or local disk problems. Storing the files locally has a couple distinct advantages too:
1) If the device is totally offline due to a configuration change and you don't have access to the server (if it's at another site and your aircard doesn't work), then it's handy to have the last working configuration file right there.
2) If the path is not a local disk, you can't specify the Maximum number of files to backup. When you specify SCP or FTP in the path, the file will get overwritten using the same name for each time period.
Pick which way works best for you. If you have a central server that can receive SCP or FTP, sending the files there will save you from localized problems such as fires, water damage, ESD, and theft. If you have another tool backing up your configs remotely, such as Kiwi CatTools and you want a local copy for insurance, store them on the local disk.
Solution
I much prefer the FTP method but see the drawbacks of only keeping the last backup.
To that end, I set up an FTP server on Windows and configured Shadow Copy to snapshot the location once a day, making for quick-n-easy restores to any point in time should the need ever occur.
NX vs Junos
Looks like they are starting to implement some features that Junos has been running for a while. I'm a Cisco guy by default and had to learn Junos and get some Juniper certs... keep adding the commands!