华为批量备份脚本
#!/bin/bash
#Route , Switch Device configuration Save script
ip_file="ip_file"
for str in $(cat ip_file)
do
{
sleep 2;
#if [[ $ignoreFirstLine =~^#. ]];then
if [[ $str == # ]]; then
continue;
fi
#echo $str;
str_arr=(${str//\,/ });
#echo -e "ip : ${str_arr[0]}\nhostname : ${str_arr[1]}\nusername : ${str_arr[2]}\npassword : ${str_arr[3]}";
for s in ${str_arr[0]}
do
{
sleep 2;
echo ${str_arr[2]};
sleep 1;
echo ${str_arr[3]};
sleep 1;
echo "screen-length 0 temporary"
sleep 1;
echo "disp cu";
sleep 3;
}|telnet $s > ${str_arr[1]}-$s.log
done
}
done
export BAK_Folder=
date '+%Y%m%d-%H%M%S'
mkdir ./$BAK_Folder
mv ./*.log ./$BAK_Folder
ip_file="ip_file"
for str in $(cat ip_file)
do
{
sleep 2;
#if [[ $ignoreFirstLine =~^#. ]];then
if [[ $str == # ]]; then
continue;
fi
#echo $str;
str_arr=(${str//\,/ });
#echo -e "ip : ${str_arr[0]}\nhostname : ${str_arr[1]}\nusername : ${str_arr[2]}\npassword : ${str_arr[3]}";
for s in ${str_arr[0]}
do
{
#echo $s;
sleep 2;
echo ${str_arr[2]};
sleep 1;
echo ${str_arr[3]};
sleep 1;
echo "screen-length 0 temporary"
sleep 1;
echo "disp cu";
sleep 3;
}|telnet $s > ${str_arr[1]}-$s.log
done
}
done
export BAK_Folder=
date '+%Y%m%d-%H%M%S'
mkdir ./$BAK_Folder
mv ./*.log ./$BAK_Folder
ip_file:
192.168.0.2,route1,username,password
192.168.1.2,switc1,username,password
192.168.2.2,route2,username,password
193.168.3.3,switc2,username,pwd
- 第三方备份虚拟机发生错误 附批量修改vmx参数脚本
- SVN 批量备份脚本
- 使用python脚本利用SSH协议通过TFTP备份批量备份山石防火墙配置
- 批量备份脚本
- 利用expect脚本实现备份华为交换机配置之(四)
- SqlSever 数据库批量备份&还原 脚本
- 批量备份,删除MySQL表(python脚本)
- shell脚本批量删除备份文件
- 批量查找/替换,包括子目录,自动备份.简单脚本.
- 批量备份H3C网络设备脚本
- 不同型号 交换机批量备份脚本 expect
- 用Shell脚本在推出的RAC节点上批量部署32个Oracle11gR2 RAC备份恢复案例场景的方法PART1 推荐
- 用Shell脚本在推出的RAC节点上批量部署32个Oracle11gR2 RAC备份恢复案例场景的方法PART2
- mysql自动批量备份脚本
- 实习笔记----脚本: SVN批量添加与删除
- Rman自动备份脚本一例
- Windows下写一个文件备份脚本(专用备份的)
- Linux 平台下 RMAN 全备 和 增量备份 shell 脚本
- oracle日常备份脚本
- MongoDB 备份脚本