commit 6ac5c3da78eef410086af50bbb1cfd070045a9b5 Author: Mattia Tadini Date: Tue Nov 19 13:20:21 2024 +0000 Add Send_Backup diff --git a/Send_Backup b/Send_Backup new file mode 100644 index 0000000..d993693 --- /dev/null +++ b/Send_Backup @@ -0,0 +1,30 @@ +## +## Automatically Backup For RouterOS With Export Config +## +## +## script by Mattia Tadini +## created: 2024-02-05 +## updated: 2024-11-19 +## tested on: RouterOS 7.16.1 / multiple HW devices, won't work on 6.49 and older (different update process & value naming) +## +:log info "Backup beginning now" +:global mail brass@relay.poloinformatico.it +:global getadate [/system clock get date] + +:global backupfile (."BACKUP-". [/system identity get name] . "-" . [:pick $getadate 8 10 ] ."-". [:pick $getadate 5 7 ] . "-" . [:pick $getadate 0 4 ] ) + +:global exportrsc (."RSC-". [/system identity get name] . "-" . [:pick $getadate 8 10 ] ."-". [:pick $getadate 5 7 ] . "-" . [:pick $getadate 0 4 ] ) + +/export file=$exportrsc +:delay 10s +/system backup save name=$backupfile + +:log info "Backup pausing for 10s" + +:delay 10s + +:global files {$backupfile;$exportrsc} +:log info "Backup being emailed" + +/tool e-mail send to=$mail subject=("Backup RouterOS on router " . [/system identity get name] . " Backup " . [:pick $getadate 8 10 ] ."-". [:pick $getadate 5 7 ] . "-" . [:pick $getadate 0 4 ]) file=$files +:log info "Backup finished" \ No newline at end of file