i wrote my own script to create a
binary and a cleartext backup with hostname, rOS version, timestamp, etc.
this script writes a backup to a given path on "disk1" which in my case is a 32GB USB Flash drive formated to ext via routerOS
creates the files if there is enough space on FLASH SYS-DISK (
otherwise one could crash the router EVEN if the destination is an EXTERNAL DISK or other disk than internal flash!!)
the default free disk which needs to be available is 1MB (set in ":local freeStoreThresh 1024;")
gives log messages to track for
can be scheduled to run
every 24h at least and scales up to desired frequency
mt-forum-usb-backup-note.png
hope it helps
some "documentation"
![Very Happy :-D](./images/smilies/icon_biggrin.gif)
via comments
:log info "primulus_CONFBKB::dailyConfigBackupD START";
#fetch timestamp stuff
:local dSysDateTime [/system clock get date]
:local dDay [ :pick $dSysDateTime 4 6 ]
:local dMon [ :pick $dSysDateTime 0 3 ]
:local dYear [ :pick $dSysDateTime 7 11 ]
#fetch rOS version
:local rosversionFull [/system resource get version]
:local rosversion [:pick [/sys reso get version] 0 [[:find [/sys reso get version] " "]]]
#get free storage ind KB
:local freeStoreK [:tonum [([/sys reso get free-hdd-space]/1024)]]
#set desired free storage threshold in KB
:local freeStoreThresh 1024;
#build destination path and filename to create
:local sBakPath "disk1/backups/configs/automated/";
:local sStamp "$dYear-$dMon-$dDay";
:local sHostname [/system identity get name];
:local sBakFileName "$sBakPath$sHostname_v$rosversion_$sStamp.backup";
:local sBakScrName "$sBakPath$sHostname_v$rosversion_$sStamp.scr";
:log warning "primulus_CONFBKB::Free Disk is --- $freeStoreK KB / routerOS $rosversionFull";
#check if free disk space is available on FLASH SYSTEM DISK
#FLASH SYS-DISK is used to "pre cache"/create the files we move to the BKP PATH as soon as file is created
:if ( $freeStoreK >= $freeStoreThresh ) do={
:log info "primulus_CONFBKB::SYSTEM Config BACKUP --> $sBakFileName";
/system backup save name=$sBakFileName;
/export verbose show-sensitive file=$sBakScrName;
:log info "primulus_CONFBKB::dailyConfigBackupD DONE";
} else={
#Backup is NOT created and an error msg is barked to the log! d'uh
:log error "primulus_CONFBKB::dailyConfigBackupD NOT DONE! Free Storage LOW!";
}
You do not have the required permissions to view the files attached to this post.