Skip to content

Mikrotik backup to local USB

Set understandable device name!

Scheduler: Name: make-local-backup Time: 03:15:00 Interval: 1d 00:00:00 Run:

/system script run make-local-backup

Script name: make-local-backup

# SET VARIABLES
# Leave var "disk" empty, if it does not exists
:local disk "disk1"
# Days to create additional file.
:local backupdays {5;10;15;20;25;30}
#
# DON EDIT LINES BELLOW
:local date [/system clock get date]
:local day [:pick $date 4 6]
:local name
:local devicename [/system identity get name]
#
# Backup for everyday
:set name [:put ($disk."/mikrotik-".$devicename."-everyday")]
/system backup save name=$name;
#
# Backup for special days, files will be overwrited
:if ( [:find $backupdays [:tonum $day] ] > 0 ) do={
    :set name [:put ($disk."/mikrotik-".$devicename."-day-".$day)]
    /system backup save name=$name;
}