mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-07-24 12:44:55 +02:00
Initial Commit. First Release
This commit is contained in:
parent
69ab2f58ca
commit
a9d2fcc235
4 changed files with 91 additions and 2 deletions
26
RouterOS_Mail_Backup.rsc
Normal file
26
RouterOS_Mail_Backup.rsc
Normal file
|
@ -0,0 +1,26 @@
|
|||
# RouterOS Function
|
||||
# Copyright (c) Grzegorz Budny
|
||||
# Creates backup and config file and sends them via email
|
||||
|
||||
:global MailBackup do={
|
||||
|
||||
:local systemName [/system identity get name];
|
||||
|
||||
:log info "...:::Mail backup started:::...";
|
||||
|
||||
/export file=$configName;
|
||||
/system backup save name=$backupName;
|
||||
|
||||
/tool e-mail send server=$smtpServer port=$smtpPort from=($systemName.$domain) \
|
||||
to=$recipient subject=($systemName." mail config backup") body="Enclosed backup files" \
|
||||
file=$configName;
|
||||
|
||||
/tool e-mail send server=$smtpServer port=$smtpPort from=($systemName.$domain) \
|
||||
to=$recipient subject=($systemName." mail backup") body="Enclosed backup files" \
|
||||
file=$backupName;
|
||||
|
||||
:log info ("...:::Backup files sent to".$recipient.":::...");
|
||||
}
|
||||
|
||||
$MailBackup configName=configName backupName=backupName smtpServer=smtpServer smtpPort=smtpPort domain=@example.com \
|
||||
recipient=recipient@example.com;
|
Loading…
Add table
Add a link
Reference in a new issue