標籤:網路裝置ios及設定檔自動化定時備份與恢複
Router> <正常登入後介面>
Router>enable <進入特權模式>
Router#configure terminal <進入全域配置模式>
Router(config)#archive <進入歸檔配置模式>
Router(config-archive)#path 備份目標地址/備份組建檔案名 <配置備份檔案產生路徑、檔案名稱>
Router(config-archive)#write-memory <儲存配置>
例:Router(config-archive)#path flash:/ 備份目標路徑 /$h-config <配置備份檔案在flash產生>
Router(config-archive)#path ftp:// IP地址 /$h-config <配置備份檔案在FTP產生>(推薦)
Router(config-archive)#write-memory <儲存配置>
其中:‘$h’的URL路徑將自動替換成主機名稱。“$h-config”為基準檔案名稱,備份成功後會自動添加參數,例如:$h-config-1、$h-config-2……$h-config-*等。備份組建檔案支援時間萬用字元。
Router(config-archive)#write-memory <儲存配置>
Router(config-archive)#time-period 備份間隔時間(分鐘) <設定配置備份間隔時間>
例:Router(config-archive)#time-period 10080 <設定每隔10080分鐘(1周)備份1次>
Router(config-archive)#exit <退出歸檔配置模式 >
Router(config)#(Ctrl+Z) <退出全域配置模式>
Router#show running-config <檢查配置參數是否正確>
Router#archive config <運行啟用存檔配置參數>
其中:手動啟用備份命令時,備份組建檔案自動添加參數為“-0”,如“$h-config-0”。
Router#show archive <查看驗證存檔配置參數運行結果>
Cisco IOS設定檔回退全部命令如下:
Router> <正常登入後介面>
Router>enable <進入特權模式>
Router#show flash: 或 dir flash: <查看flash中備份檔案產生時間,查看FTP備份檔案的產生時間就不用我說了吧>
Router#configure replace 設定檔備份位置 <回退IOS配置參數>
例:Router#configure replace ftp:// IP地址 /$h-config-*
Router#show running-config <檢查配置參數是否回退成功>
思科網路裝置IOS及設定檔自動化定時備份與恢複