Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Script auto backup userman mikrotik kirim ke akun g-mail
- #Sebelum copas di new terminal, silahkan sesuaikan akun g-mail nya ya....
- /tool e-mail
- set address=74.125.127.109 from=<Mikrotik_Nubie> password="nubie" \
- port=587 start-tls=yes user=nubie
- /system script
- add comment=userman_backup name=userman_backup owner=admin policy=\
- ftp,reboot,read,write,policy,test,password,sniff,sensitive source="#----deklarasi \
- variable---\r\
- \n:local ds [/system clock get date]\r\
- \n:set ds ([:pick \$ds 7 11].[:pick \$ds 0 3].[:pick \$ds 4 6])\r\
- \n:local identitasRouter [/system identity get name];\r\
- \n:local emailTujuan [/tool e-mail get from];\r\
- \n:local seriMikrotik [/system resource get board-name];\r\
- \n#-----Backup Usermanager KJG1119---------------\r\
- \n:local usermanBackup (\$identitasRouter.\$seriMikrotik.\"-userman-\".\$ds.\".umb\
- \")\r\
- \n/tool user-manager database save name=\$usermanBackup;\r\
- \n#-----Mengirim email-------------------\r\
- \n:delay 10s\r\
- \n:log info \"Sedang mengirim email, silahkan tunggu beberapa detik...\"\r\
- \n/tool e-mail send to=\"nubie@gmail.com\" from=\"nubie@gmail.com\" server=\
- \"74.125.127.109\" subject=\$usermanBackup body=\$usermanBackup file=\$usermanBack\
- up;\r\
- \n#-----menghapus -----------------------\r\
- \n:delay 60s\r\
- \n:if ([:len [/file find name=\$usermanBackup]] > 0) do={/file remove \$usermanBac\
- kup}\r\
- \n:log info \"File \$usermanBackup telah dihapus..!\""
- /system scheduler
- add comment=backup_userman interval=1d name=backup_userman on-event=userman_backup \
- policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
- start-date=apr/10/2017 start-time=09:00:00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement