cisco设备自动备份脚本
来源:互联网 发布:淘宝直播正式上线运营 编辑:程序博客网 时间:2024/04/28 13:31
linux下交互式登录工具:expect
需要自己安装
yum install expect
安装完成即可,expect功能非常强大……
脚本代码如下
iplist.dat为设备IP文件
serverlist.dat为tftp备份服务器IP文件
这样添加设备或者更改tftp服务器IP的话只需要修改这2个文件即可,不需要修改脚本。
将该脚本放到计划任务中执行,将输出结果重定向到/dev/null。
#!/usr/bin/expect -f
set IPlist [exec cat /tmp/iplist.dat]
set Serverlist [exec cat /tmp/serverlist.dat]
foreach Ser $Serverlist {
foreach IP $IPlist {
spawn telnet $IP
expect "Username:"
send "username\n"
expect "Password:"
send "******\n"
expect "#"
send "copy running-config tftp:\n"
expect "Address or name of remote host"
send "$Ser\n"
expect "Destination filename"
send "\n"
expect "#"
send "exit\n"
expect eof
}
}
- cisco设备自动备份脚本
- 通过脚本自动登录设备进行设备配置备份CRT vbs脚本
- LINUX 自动备份脚本
- mysql自动备份脚本
- VSS自动备份脚本
- MYSQL自动备份脚本
- mysql自动备份脚本
- 自动备份脚本
- Oracle自动备份脚本
- 自动备份mysql脚本
- mysql自动备份脚本
- sharepoint自动备份脚本
- mysql自动备份脚本
- postgreSQL 自动备份脚本
- oracle自动备份脚本
- db2自动备份脚本
- 自动备份脚本
- SQLServer--<<自动备份>>脚本
- java-mysql异常<Data truncation: Data too long for column 'name ' at row 1>讨论
- MTK HTTP 协议之日志写入
- Delphi常用代码汇总
- php date_default_timezone_set!时区设置
- IP解锁
- cisco设备自动备份脚本
- 各种排序算法的比较
- 数据库分库分表(sharding)系列(一) 拆分实施策略和示例演示
- sql group by和having 的用法
- Spring入门Blog[十、Spring DBCP用xml和properties2种格式配置DataSource]
- 命名用jquery扩充命名空间
- Ubuntu11.10(32位)编译android常见错误(30种常见的)
- Application Domains
- git实战记录