How to Mikrotik Automatic Backup
So if you wanna backup whole system (including passwords for example) use system backup. But if you need a quick look at configuration or part of the configuration you need to use export because system backup gives you the binary file you can’t read simply with a text editor.
This script takes backup
and RSC (txt)
format to overwrite the desired time intervals. Same time of the 1st of every month backup. So we get 12 backups a year.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | /system scheduler add comment=Automatic System Backup Don't Delete interval=7d name=System_Bacup on-event="# Daily Backup Script\r\ \n#\r\ \n# Create Daily Scheduler.\r\ \n# Every day will be backed up and monthly backups will occur\r\ \n#-----------------------------------------------------------------\r\ \n:local varSistem; \r\ \n:local varIdenty;\r\ \n:local varTarih;\r\ \n:local varAy;\r\ \n:local varYil;\r\ \n:local varName;\r\ \n#-----------------------------------------------------------------\r\ \n# Getting Date and Description Information\r\ \n#-----------------------------------------------------------------\r\ \n:set varTarih [/system clock get date];\r\ \n:set varAy [:pick \$varTarih 0 3];\r\ \n:set varYil [:pick \$varTarih 7 11];\r\ \n:set varIdenty [/system identity get name];\r\ \n:set varName [/system reso get board-name];\r\ \n#-----------------------------------------------------------------\r\ \n#Creating file naming.\r\ \n#-----------------------------------------------------------------\r\ \n:set varSistem (.[\$varIdenty].\"-\".\$varName.\"-Current_System_\".\$varAy.\"-\".\$varYil);\r\ \n#-----------------------------------------------------------------\r\ \n# Backup dosyalari Hazirlaniyor.\r\ \n#-----------------------------------------------------------------\r\ \n/system backup save name=\$varSistem\r\ \n/export file=\$varSistem\r\ \n#-----------------------------------------------------------------\r\ \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=jul/30/2019 start-time=00:00:00 |