ROS自动备份脚本
每隔2天,在01:30自动备份脚本:/system scheduler
add disabled=no interval=2d name=autobak on-event=\
"/ file remove autobak.backup\r\
\n/ system backup save name=autobak" policy=\
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
start-date=jan/04/2013 start-time=01:30:00
亲 你这是6.X以上版本的吧 不适合5.X的版本吧!也一下吧谢谢 呵呵 一看就是覆盖备份法,
既然发了, 至少也得发个7天备份法,才有脸发帖 挺好的 ,值得鼓励 本帖最后由 cspm333 于 2016-5-23 19:00 编辑
ROS自動備份設定檔到個人E-mail信箱:
/tool e-mail
http://i.imgur.com/VWEg49k.png
server ip請隨意填寫,透過script會自動修正成正確的.
script: (請將script放到排程,讓排程依您設定的時間自動執行)
:local SMTP "msa.hinet.net"
:local MailFrom "abc1234@xuite.net"
:local MailTo "abc1234@msa.hinet.net"
:local name
:local date
:local time
:local BackupFileName "$name_Backup-$[:pick $date 7 11]$[:pick $date 0 3]$[:pick $date 4 6].backup"
/system backup save name=$BackupFileName
:delay 5s
:if (!=$MailFrom) do={/tool e-mail set from=$MailFrom}
:if (!=[:resolve $SMTP]) do={/tool e-mail set address=[:resolve $SMTP]}
/tool e-mail send to=$MailTo \
subject="$name -- RouterOS Backup $[:pick $date 7 11]$[:pick $date 0 3]$[:pick $date 4 6]" \
file=$BackupFileName
:delay 10s
/file remove $BackupFileName
:log info "System Backup emailed at $time $date (備份email寄出)"
本帖最后由 xuxi3201 于 2016-5-23 22:02 编辑
楼上的 水平就是高
页:
[1]