22
Ноя

Сливаем бекап настроек Mikrotik к себе на email

Добавляем скрипт в System — Scripts , например с именем backup
После чего добавляем в System — Scheduler задание с именем backup и выбираем желаемый интервал выполнения.
Для проверки скрипта, можно его запустить и получить на почту текущие настройки. Очень полезно когда Вы экспериментируете со своим оборудованием.

[bash title=»код»]{
:log info "Starting Backup Script…";
:local sysname [/system identity get name];
:local sysver [/system package get system version];
:log info "Flushing DNS cache…";
/ip dns cache flush;
:delay 2;
:log info "Deleting last Backups…";
:foreach i in=[/file find] do={:if ([:typeof [:find [/file get $i name] \
"$sysname-backup-"]]!="nil") do={/file remove $i}};
:delay 2;
:local smtpserv [:resolve "smtp.hd.zp.ua"];
:local Eaccount "[email protected]";
:local pass "pass00111";
:local backupfile ("$sysname-backup-" . \
[:pick [/system clock get date] 7 11] . [:pick [/system \
clock get date] 0 3] . [:pick [/system clock get date] 4 6] . ".backup");
:log info "Creating new Full Backup file…";
/system backup save name=$backupfile;
:delay 2;
:log info "Sending Full Backup file via E-mail…";
/tool e-mail send from="< $Eaccount>" to=$Eaccount server=$smtpserv \
port=587 user=$Eaccount password=$pass start-tls=yes file=$backupfile \
subject=("$sysname Full Backup (" . [/system clock get date] . ")") \
body=("$sysname full Backup file see in attachment.\nRouterOS version: \
$sysver\nTime and Date stamp: " . [/system clock get time] . " " . \
[/system clock get date]);
:delay 5;
:local exportfile ("$sysname-backup-" . \
[:pick [/system clock get date] 7 11] . [:pick [/system \
clock get date] 0 3] . [:pick [/system clock get date] 4 6] . ".rsc");
:log info "Creating new Setup Script file…";
/export verbose file=$exportfile;
:delay 2;
:log info "Sending Setup Script file via E-mail…";
/tool e-mail send from="< $Eaccount>" to=$Eaccount server=$smtpserv \
port=587 user=$Eaccount password=$pass start-tls=yes file=$exportfile \
subject=("$sysname Setup Script Backup (" . [/system clock get date] . \
")") body=("$sysname Setup Script file see in attachment.\nRouterOS \
version: $sysver\nTime and Date stamp: " . [/system clock get time] . " \
" . [/system clock get date]);
:delay 5;
:log info "All System Backups emailed successfully.\nBackuping completed.";
}[/bash]

Обратная связь

    The average number of adverse effects was 3. T max is 23 minutes in females and 32 minutes in males. What other drugs will affect doxercalciferol Viagra natural sin receta. Archived from the original on 2009-08-14.

    Talk to your doctor before using this form of cefadroxil if you have diabetes. What should I tell my healthcare team before starting CABLIVI? There is no FDA guidance on the use of Tetracycline (oral) with respect to specific gender populations https://www.apotheke-rezeptfreie.com/. Opper K, Uder S, Song K Development of Heterogeneous and Homogeneous Platforms for Rapid Analysis of DNA-Protein Interactions.

    Contact Us