/system script
add name=e-config policy=ftp,reboot,read,write,policy,test source=”# System Ba
ckup Script for 3.xr
n# 3.17 tested.r
nr
n:local p1 [:find [/system clock get date] “/” ]r
n:local p2 [:find [/system clock get date] “/” $p1 ]r
n:local daynumber [:pick [ /system clock get date ] ($p1+1) $p2 ]r
n:local myname [/system identity get name]r
n:local myversion [/system resource get version ]r
n:local mailfrom “[email protected]”r
n:local rcptto “[email protected]”r
nr
n/export file=(“export-” . $daynumber)r
nr
n/tool e-mail send to=”$rcptto” from=”$mailfrom” subject=(“{mtback
up} $myname $myversion export”) body=”See attached file for configurat
ion export.” file=(“export-” . $daynumber . “.rsc”)r
nr
n/system backup save name=(“backup-” . $daynumber)r
nr
n/tool e-mail send to=”$rcptto” from=”$mailfrom” subject=(“{mtback
up} $myname $myversion backup”) body=”See attached file for configurat
ion backup.” file=(“backup-” . $daynumber . “.backup”)r
nr
n:log info “Completed backup.”r
n”