Skip to content

Instantly share code, notes, and snippets.

@lichti
Created July 5, 2016 21:43
Show Gist options
  • Save lichti/ff02de4ef1e594c33b8cb9ba0f5f10b0 to your computer and use it in GitHub Desktop.
Save lichti/ff02de4ef1e594c33b8cb9ba0f5f10b0 to your computer and use it in GitHub Desktop.
backup.mikrotik.script
:log info "backup beginning now";
:local varEmail "[email protected]";
:local varEmailSubj "Backup";
:local Hostname [/system identity get name];
:local varDate [/system clock get date];
:local varMonth [:pick $varDate 0 3];
:local varDay [:pick $varDate 4 6];
:local varYear [:pick $varDate 7 11];
:local varDateTime ([$varYear]."-".[$varMonth]."-".[$varDay]."-".[/system clock get time]);
:local subject ([/system identity get name] . " - " . [$varEmailSubj] . " - " . [$varDateTime]);
:local backupfile ([/system identity get name]. "-" . [$varDateTime]);
/system backup save name=$backupfile;
:delay 10s;
/tool e-mail send to=$varEmail subject=$subject file=$backupfile;
:log info "backup finished";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment