ROS自动备份发送到邮箱脚本
#SMTP服务器设置 :local smtps "smtp.163.com" #邮件端口设置 :local ports "25" #寄件人设置 :local Mailings "rosnewip@163.com" #寄件人密码设置 :local pass "ros20130108" #收件人设置 :local Collection "ccxue@qq.com" #发送内容设置 :local Contents "邮件发送时的公网IP是:" #发送主题设置 :local Themes "ROS备份文件" #接口名称设置 :local ddnsinterface "pppoe-out1" #备份文件名称设置 :local backupname "rosconfig" #服务器名称设置 :local ServerName "附件为您RouterOS最新的配置备份文件" :global ipss :global ipssfn :global null $ipss /system backup save name=$backupname :local smtpp [:resolve $smtps] :local szccc "ROS资源网(www.ros9.com) 提供支持" :local xueyingsz "技术问题请联系我们" :local Belief "RouterOS技术支持QQ:962000293" /tool e-mail set address=$smtpp port=$ports from=$Mailings user=$Mailings password=$pass :global ddnssystems ("MikroTik v" . [/system package get system version] ) :local ipssfn [ /ip address get [/ip address find interface=$ddnsinterface ] address ] :global ipss [:pick $ipssfn 0 [:find $ipssfn "/" ] ] /tool e-mail send to=$Collection subject=$Themes body=("$ServerName\n$ddnssystems\n $Contents$ipss\n\n$xueyingsz\n$Belief\n$szccc") file=$backupname :log warning "数据已备份,邮件已发送(www.roszj.com)" :log warning ("address=" ."$ipss")
*脚本依赖DNS解析。使用前检查ROS的DNS设置(ip-dns)
*脚本来自网络,5.20经测试可用。
评论前必须登录!
注册