需求
v6及以上版本
注意:请注意,Dude在数据库导出/导入过程中停止了!
配置
1.创建一个脚本。
System -> Scripts:
名称:backup-dude-to-ftp
政策:Ftp,读,写,测试
来源:
代码:选择所有
FTP # # # #备份老兄定义变量:当地ftphost“> < FTP服务器主机”:当地ftpuser“FTP用户> <”:当地ftppassword“> < FTP密码”:当地ftppath“/”:当地dudeconffilename“Dude_configuration_backup”:当地dudedbfilename“Dude_db_backup”:当地dudeconffileext“rsc”:当地dudedbfileext“分贝”:当地localbackuppath“disk1”# # #{日期和时间:当地curDate[/系统时钟得到日期]:当地curTime[/系统时钟得到时间]:当地systemName[/系统身份得到名称]:当地curMonth [:pick $curDate 0 3]:set curMonth ([: find key="$curMonth" in="jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec" from=-1] / 4 + 1) if ($curMonth < 10) do={:set curMonth ("0".)$curMonth)} else={:set curMonth $curMonth}:local curDay [:pick $curDate 4 6]:local curYear [:pick $curDate 7 13]:local curHour [:pick $curTime 0 2]:local curMin [:pick $curTime 3 5]:local now ("$curYear"."$curMonth".)"$curDay" ."-"."$curHour"."$curMin") # #本地备份#:日志警告消息="本地开始备份";/dude export file="$localbackuppath/$dudeconffilename_$now. "$dudeconffileext" /dude export-db backup-file="$localbackuppath/$dudedbfilename_$now. "$dudedbfileext":log警告消息="本地备份完成";#:log warning message="Dude backup to FTP started";/tool fetch address="$ftphost" src-path="$localbackuppath/$dudeconffilename_$now. "$dudeconffileext" user="$ftpuser" mode=ftp password="$ftppassword" dst-path="$ftppath/$dudeconffilename_$now. "$dudeconffileext" upload=yes /tool fetch address="$ftphost" src-path="$localbackuppath/$dudedbfilename_$now. "$dudedbfileext" user="$ftpuser" mode=ftp password="$ftppassword" dst-path="$ftppath/$dudedbfilename_$now. txt "$dudedbfileext" upload=yes:log警告消息="备份到FTP完成";# #删除本地创建的文件#:log警告消息=" deleting local created backups started";文件删除$localbackuppath/$dudeconffilename_$现在。$dudeconffileext" file remove "$localbackuppath/$dudedbfilename_$now.$dudedbfileext" :log warn message="Removing locally created backups finished"; # }
2.制定一个时间表。
System -> Scheduler:
名称:backup-dude-to-ftp
开始一天:11月/ 07/2017
开始时间:02:00:00
间隔:1 d就是
政策:Ftp,读,写,测试
事件:dude-backup-to-ftp
恢复备份
如果需要,您可以从最近创建的备份中恢复Dude v6:
代码:选择所有
/dude set enabled=no /import Dude_configuration_backup_20171107-0200。rsc /dude import-db backup-file=Dude_db_backup_20171107-0200.db /dude set enabled=yes
使用的材料
1.Dude v6 -本地备份
2.备份到外部FTP有用的脚本
3.RouterOS自动l雷竞技备份到FTP
相关解决方案
1.Dude v6 -本地备份