Advertisement
kajege

Auto Backup User Manager Mikrotik

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