0% found this document useful (0 votes)
210 views2 pages

Kirim Konfigurasi Backup Mikrotik Via Email

The document describes the process of backing up a Mikrotik router configuration. It performs the following steps: 1. Creates backup files for the router configuration, export, and user manager database. 2. Sends the backup files via email using Gmail SMTP with the current date in the subject line. 3. Deletes the local backup files. The process is automated to run backups periodically.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
210 views2 pages

Kirim Konfigurasi Backup Mikrotik Via Email

The document describes the process of backing up a Mikrotik router configuration. It performs the following steps: 1. Creates backup files for the router configuration, export, and user manager database. 2. Sends the backup files via email using Gmail SMTP with the current date in the subject line. 3. Deletes the local backup files. The process is automated to run backups periodically.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

:log info "Mikrotik Backup JOB Started . . .

By Saman Supriadi"
:global backupfile configbackup
:global mikrotikexport mtexport_backup
:global umbackup um_backup
:global gmailsmtp
:set gmailsmtp [:resolve "smtp.gmail.com"];
:log info "Deleting old Backup File If available otherwise ignore & process furt
her . . . "
/system backup save name=$backupfile
/export file=$mikrotikexport
/tool user-manager database save name=$umbackup
:log info "Backup process pausing for 30s so it may complete creating backup fil
es"
:delay 30s
:log info "Start Sending Backup File via Email using GMAIL SMTP . . ."
/tool e-mail send to="samansenju@gmail.com" password=@987654321@ subject=([/syst
em clock get date] . \
" Mikrotik Config Backup by Saman") from=samansenju@gmail.com file=$backupfile s
erver=$gmailsmtp tls=yes
/tool e-mail send to="samansenju@gmail.com" password=@987654321@ subject=([/syst
em clock get date] . \
" Mikrotik Export Backup by Saman") from=samansenju@gmail.com file=$mikrotikexpo
rt server=$gmailsmtp tls=yes
/tool e-mail send to="samansenju@gmail.com" password=@987654321@ subject=([/syst
em clock get date] . \
" Mikrotik UM Backup by saman") from=samansenju@gmail.com file=$umbackup server=
$gmailsmtp tls=yes
:delay 60s
:log info "Backup Finished"
:log info "Deleting Backup File. All Done. "
/file remove $backupfile
/file remove $mikrotikexport
/file remove $umbackup

/system backup save name=$backupfile


/export file=$mikrotikexport
/tool user-manager database save name=$umbackup
/tool e-mail send to="samansenju@gmail.com" password=@987654321@ subject=([/syst
em clock get date] . \
/tool e-mail send to="samansenju@gmail.com" password=@987654321@ subject=([/syst
em clock get date] . \
/tool e-mail send to="samansenju@gmail.com" password=@987654321@ subject=([/syst
em clock get date] . \
/file remove $backupfile
/file remove $mikrotikexport
/file remove $umbackup
================================================================================
=========================
:global DateToNum " :local output \"\"
:set input [:toarray \$input]
:if ([:len \$input] > 0) do={

:local input1 [:tostr [:pick \$input 0]]


:local months [:toarray \"jan,feb,mar,apr,may,jun,jul,aug,sep,oct,no
v,dec\"]
:local mon 0
:for x from=0 to=([:len \$months] - 1) do={
:if ([:tostr [:pick \$months \$x]] = [:tostr [:pick \$input1 0 3]
]) do={
:if (\$x < 9) do={ :set mon (\"0\" . (\$x + 1)) } else={ :set
mon (\$x + 1) } } }
:set output ([:pick \$input1 7 11] . \$mon . [:pick \$input1 4 6])
:set output [:tonum \$output]
:set output [:toarray \$output]
};"
:global ConDate 0
:local runFunc
[:parse (":global ConDate;" . \
":local input [/system clock get date]; " . \
$DateToNum . \
":set ConDate \$output")
]
$runFunc
:log warning "Mulai backup ..."
:global backupfile ([/system identity get name] . " - " . [/system clock get tim
e]."-". [:pick $ConDate 0])
/system backup save name=$backupfile
:delay 10s
:global sendbackup ($backupfile.".backup")
:log info "Mengirim file backup ..."
/tool fetch user=saman@ns2.melsa.net.id password=12345 address=ftp://ns2.melsa.n
et.id host=ftp://ns2.melsa.net.id src-path=$sendbackup dst-path=$sendbackup mode
=ftp upload=yes
:delay 10s
:log warning "Backup sukses !"
:delay 2s
:log warning ("Menghapus temp backup file ...")
/file remove "$backupfile"

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy