不涉及
客户需求:定期备份配置文件到目标主机
定时任务+python脚本实现
命令行配置:
# scheduler job backcfg
command 1 save fo
command 2 python HXbackcfg.py
# scheduler schedule backcfgauto
user-role network-operator
user-role network-admin
job backcfg time
repeating at 02:30
#
py脚本:
#!/usr/bin/python
#_*_ coding:utf-8 _*_
import time
import comware
import socket
a=str(socket.gethostname())
b=str(time.strftime('%d%b%Y'))
c=('tftp 1.1.1.1 put startup.cfg /'+a+'/'+a+'_'+b+'.cfg vpn-instance vpn-mgt')
comware.CLI(c)