2019-10-14 20:53:37 +02:00
|
|
|
# RouterOS Function
|
|
|
|
# Copyright (c) Grzegorz Budny
|
2020-02-28 21:26:06 +01:00
|
|
|
# Version 1.1
|
|
|
|
# Last update: 2/14/2020
|
2019-12-01 11:28:00 +01:00
|
|
|
# Creates new backup file and uploads it to MikroTik Cloud
|
2019-10-14 20:53:37 +02:00
|
|
|
|
|
|
|
:global CloudBackup do={
|
|
|
|
|
|
|
|
:local systemLicense [/system license get value-name=level];
|
2020-02-28 21:26:06 +01:00
|
|
|
:local systemName [/system identity get value-name=name];
|
2019-10-14 20:53:37 +02:00
|
|
|
|
|
|
|
:if ($currentLicenseLevel != "free") do={
|
|
|
|
|
|
|
|
:log info "...:::License allows cloud backup, process started:::..."
|
|
|
|
|
|
|
|
/system backup cloud upload-file action=create-and-upload file=cloudBackup.backup password=password
|
|
|
|
|
|
|
|
/tool e-mail send server=$smtpServer port=$smtpPort from=($systemName.$domain) \
|
|
|
|
to=$recipient subject=($systemName." cloud backup created.") body=($systemName." created MikroTik cloud backup.");
|
|
|
|
|
|
|
|
:log info "...:::Cloud Backup Created:::...";
|
|
|
|
|
|
|
|
}
|
2019-12-01 11:28:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$CloudBackup smtpServer=smtpServer smtpPort=smtpPort domain=@example.com recipient=recipient@example.com;
|