GithubHelp home page GithubHelp logo

switchautobackup's Introduction

SwitchAutoBackup

H3C 交换机批量备份(多进程并发)

开发背景

公司内部署有200多台H3C交换机,为保障交换机因故障替换时及时恢复网络,特编写此脚本每日备份交换机配置至tftp服务器,备份文件名格式为: ip-日期.bak.cfg,ip内的"."用"-"替代,如:192-168-29-1-20191111.bak.cfg

环境需求

  1. 一台具备python3 执行环境的机器
  2. 一台tftp服务器
  3. 被管理交换机已开启Telnet登陆,并设置相应的用户和密码及执行backup命令的权限

使用方法

  1. 将Switch_AutoBackup.py与switchs.txt放在同一目录内
  2. 编辑Switch_AutoBackup.py,填入本地环境相应的信息
#交换机具备backup命令的telnet用户
        username = 'admin'
        #该用户密码
        password = 'admin'
        #tftp服务器地址
        ftphost ='192.168.32.11'
  1. 编辑switchs.txt,填入需要备份配置的交换机管理ip地址,每行一台
192.168.29.1
192.168.29.10
  1. 根据自己的需求将如下命令设置为Windows或Linux计划任务
python3 Switch_AutoBackup.py

Telnet代码源自网络,前人栽树,后人乘凉,感谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.