İçeriğe atla

mikrotik otomatik yedekleme

Mikrotik Gmail Hesabına Yedekleme

Aşagıdaki kodları terminale yazmanız yeterlidir.

Değiştirmeniz gereken yerler:

Öncelikle değiştirmeniz gereken yerler:

gmailuser GMAILUSERNAME
gmailid YOUREMAILID@gmail.com
global gmailpwd YOURCURRENTPASSWORD

global recmail RECEIVEREMAILADDRESS

/system script
add name=BackupEmail source="# Enter Sender/Receiver Details.\r\
\n\r\
\n:global gmailuser GMAILUSERNAME\r\
\n:global gmailid YOUREMAILID@gmail.com\r\
\n:global gmailpwd YOURCURRENTPASSWORD\r\
\n\r\
\n## --- Aşağıda değiştirmeyin ---- ##\r\
\n\r\
\n\r\
\n# Enter Receiver Details.\r\
\n:global recmail RECEIVEREMAILADDRESS\r\
\n\r\
\n## --- Do not change below ---- ##\r\
\n\r\
\n#:log warning \"Mikrotik Router Backup JOB Started . . . \"\r\
\n:local gmailip\r\
\n:set gmailip [:resolve \"smtp.gmail.com\"]\r\
\n:global backupfile configbackup\r\
\n:global mikrotikexport mtexport_backup\r\
\n:global sub1 ([/system identity get name])\r\
\n:global sub2 ([/system clock get time])\r\
\n:global sub3 ([/system clock get date])\r\
\n:log warning \"Creating new up to date backup files . . . \"\r\
\n\r\
\n/system backup save dont-encrypt=yes name=\$backupfile\r\
\n/export compact file=\$mikrotikexport\r\
\n\r\
\n/tool e-mail set address=\$gmailip from=\$gmailid password=\$gmailpwd port=587 start-tls=yes user=\$gmailuser\r\
\n\r\
\n:log warning \"Backup process pausing for 10s so it can complete creating backup if system is busy ...\"\r\
\n:delay 10s\r\
\n:log info \"Start Sending Backup File via Email using GMAIL SMTP . . .\"\r\
\n/tool e-mail send to=\$recmail password=\$gmailpwd subject=\"\$sub3 \$sub2 \$sub1 Configuration BACKUP File\" from=\$gmailid file=\$backupfile server=\$gmailip start-tls=yes\r\
\n:delay 30s\r\
\n/tool e-mail send to=\$gmailid password=\$gmailpwd subject=\"\$sub3 \$sub2 \$sub1 Configuration EXPORT File\" from=\$gmailid file=\$mikrotikexport server=\$gmailip start-tls=yes\r\
\n# Delete Old backup files to save space.\r\
\n/file remove \$backupfile\r\
\n:delay 30s\r\
\n/file remove \$mikrotikexport\r\
\n/tool e-mail set address=0.0.0.0 from=<> password=xxxx port=25 start-tls=yes user=yourid\r\
\n:log warning \"Backup Finished & Backup File Removed. All Done. You should verify your inbox for confirmation\""

Aşagıdaki kodu zamanlanmış görevlere ekleyiniz


/system scheduler
add interval=1d name=BackupByEmail on-event=BackupEmail start-date=apr/03/2016 start-time=00:15:00