Mikrotik Auto Backup Via Email | MTCNA | Lecture 5

Опубликовано: 02 Октябрь 2024
на канале: Kamran Awan
632
21

For checking email configuration, send a test mail from MikroTik with below cmd:/tool e-mail
send to=Your [email protected] subject=”email test” body=”email test”

Script:

:local emailAddress "Your [email protected]"
:log info "BACKUP STARTING NOW"
:global backupfile ([/system identity get name] . "-" . [/system clock get time])
/system backup save name=$backupfile
:log info "BACKUP FILE SAVED, SENDING EMAIL IN 2 SECONDS"
:delay 2s
/tool e-mail send to="Your [email protected]" subject=([/system identity get name] . " Backup " . [/system clock get date] . " " . [/system clock get time]) file=$backupfile
:delay 15s
:log info "BACKUP EMAIL SENT, REMOVING BACKUP FILE"
/file remove $backupfile
:log info "BACKUP FINISHED"



#mikrotik
#mtcna
#OnlineITEducation
#OnlineEducation
#ITEducation
#Kamranawan