Script Backup Mikrotik Ke Gmail

Created By Aria Perdana, S.Kom (xenderautoshop)

Enter Sender/Receiver Details.

:global gmailuser failover.mikrotik
:global gmailid yyyyyy@gmail.com
:global gmailpwd xxxx (generate dari password app di account manager)

Enter Receiver Details.(alamat email penerima)

:global recmail zzzzz@gmail.com

:log warning “Mikrotik Router Backup JOB Started . . . “

:local gmailip
:set gmailip [:resolve “smtp.gmail.com”]
:global backupfile configbackup
:global mikrotikexport mtexport_backup
:global sub1 ([/system identity get name])
:global sub2 ([/system clock get time])
:global sub3 ([/system clock get date])
:log warning “Sedang Mempersiapkan File Backup….”

/system backup save dont-encrypt=yes name=$backupfile
/export compact file=$mikrotikexport

/tool e-mail set address=$gmailip from=$gmailid password=$gmailpwd port=587 start-tls=yes user=$gmailuser

:log warning “Backup Sedang Di Proses Tunggu 10detik Sampai Proses Backup Lengkap …”
:delay 10s
:log info “Start Sending Backup File via Email using GMAIL SMTP . . .”
/tool e-mail send to=$recmail password=$gmailpwd subject=”$sub3 $sub2 $sub1 Configuration BACKUP File” from=$gmailid file=$backupfile server=$gmailip start-tls=yes
:delay 30s
/tool e-mail send to=$recmail password=$gmailpwd subject=”$sub3 $sub2 $sub1 Configuration EXPORT File” from=$gmailid file=$mikrotikexport server=$gmailip start-tls=yes
:delay 30s

Delete Old backup files to save space.

/file remove $backupfile
:delay 30s
/file remove $mikrotikexport
:log warning “Proses Backup Selesai & File Backup Telah di Hapus Dari Sistem, Pastikan File Config Sudah Terkirim Ke Email Anda… Terima Kasih”

Leave a Reply

Your email address will not be published. Required fields are marked *