Follow us on...
Follow us on G+ Follow us on Twitter Follow us on Facebook Watch us on YouTube
Register
Page 1 of 3 123 LastLast
Results 1 to 15 of 37
  1. #1
    Status
    Offline
    cw-12's Avatar
    Member Senior
    Join Date
    Jan 2010
    Posts
    391
    Reviews
    Read 0 Reviews
    Downloads
    5
    Uploads
    2
    Feedback Score
    0

    [Share] Cara Backup Konfigurasi Mikrotik ke Email.

    Haii, berjumpa lagi dengan cw-12, masih dengan sharing yang ringan-ringan yah, kali ini saya akan menuliskan sedikit tentang "Cara Backup Konfigurasi Mikrotik ke Email".

    NOTE

    Latar Belakang.
    sebagai seorang admin jaringan dan pengoprek Mikrotik, saya kadang/sering nya kerepotan untuk menyimpan atau mengingat-ingat setingan atau konfigurasi router-router Mikrotik, yang jumlahnya banyak, lebih dari 5 router, yang biasa saya lakukan adalah menyimpan backup sistem-sistem tersebut melalui tools backup yang ada ataupun juga dengan mengekspor setingan-setingan itu, dan menyimpannya ditempat lain. tampaknya sudah lumayan aman, tapi tetap saja disimpan di harddisk komputer/eksternal resiko hilang juga besar.
    Nah, alangkah baiknya disimpan di email saja gan. dijamin aman dan sewaktu-waktu bisa diambil, (*asal gak kena hack ajah emailnya Click here to enlarge).
    Click here to enlarge


    Ok langsung ajah, sebelum basi beneran.

    Pertama-tama, kita harus menyiapkan SMTP servernya, dalam hal ini kita pakai punya Google saja yang gratisan.
    Code:
    [xxx@RouterOnePde] > /tool e-mail pr
       address: 74.125.39.109
          port: 25
          from: [GANTI-DENGAN-ALAMAT-EMAIL-ANDA]
          user: [GANTI-DENGAN-ALAMAT-EMAIL-ANDA]
      password: [GANTI-DENGAN-PASSWORD-EMAIL-ANDA]
    [xxx@RouterOnePde] > 
    
    - untuk ip, bisa pakai ip tersebut atau 74.125.127.108 atau 74.125.127.109, dengan port 25.
    - untuk parameter from dan user dapat diisi dengan alamat email yang sama, artinya mengirim ke alamat itu sendiri.
    ok, SMTP sudah siap, selanjutnya disiapkan apa-apa saja yang akan di backup, atau lebih mudahnya ada script seperti berikut :
    simpan dengan nama "BackupEmailRsc".
    Code:
    #----var-var-----
    #:local ts [/system clock get time]
    #:set ts ([:pick $ts 0 0].[:pick $ts 3 5].[:pick $ts 6 8])
    :local ds [/system clock get date]
    :set ds ([:pick $ds 7 11].[:pick $ds 0 3].[:pick $ds 4 6])
    :local sysName [/system identity get name];
    :local destEmail [/tool e-mail get from];
    :local boardName [/system resource get board-name]; 
    #---------------------------------------------------------------------------------------------
    #-----BackupSystemAll-----
    :local SysAll ($sysName.$boardName."-SysAll-".$ds.".backup")
    /sys backup save name=$SysAll;
    #-----mangle----
    :local Mangle ($sysName.$boardName."-Mangle-".$ds.".rsc")
    /ip firewall mangle export file=$Mangle;
    #-----queue-----
    :local Queue ($sysName.$boardName."-Queue-".$ds.".rsc")
    /queue tree export file=$Queue;
    #-----firewall-----
    :local Firewall ($sysName.$boardName."-Firewall-".$ds.".rsc")
    /ip firewall filter export file=$Firewall;
    #-----script-----
    :local Script ($sysName.$boardName."-Script-".$ds.".rsc")
    /sys script export file=$Script;
    #-----scheduler-----
    :local Scheduler ($sysName.$boardName."-Scheduler-".$ds.".rsc")
    /sys scheduler export file=$Scheduler;
    #-----e-mail-----
    :local Email ($sysName.$boardName."-Email-".$ds.".rsc")
    /tool e-mail export file=$Email;
    
    :log info "Created $Mangle, $Queue, $Firewall, $Script, $Scheduler, $Email success..";
    #-----send email----
    #-----sysall-----
    :delay 30s
    :log info "Sending e-mail process..please wait."
    /tool e-mail send subject=$SysAll body=$SysAll to=$destEmail tls=yes file=$SysAll
    #-----mangle-----
    :delay 30s
    /tool e-mail send subject=$Mangle body=$Mangle to=$destEmail tls=yes file=$Mangle
    #-----queue-----
    :delay 30s
    /tool e-mail send subject=$Queue body=$Queue to=$destEmail tls=yes file=$Queue
    #-----firewall-----
    :delay 30s
    /tool e-mail send subject=$Firewall body=$Firewall to=$destEmail tls=yes file=$Firewall
    #-----Script-----
    :delay 30s
    /tool e-mail send subject=$Script body=$Script to=$destEmail tls=yes file=$Script
    #-----Scheduler-----
    :delay 30s
    /tool e-mail send subject=$Scheduler body=$Scheduler to=$destEmail tls=yes file=$Scheduler
    #-----Email-----
    :delay 30s
    /tool e-mail send subject=$Email body=$Email to=$destEmail tls=yes file=$Email
    :log info "Sending e-mail $Mangle, $Queue, $Firewall, $Script, $Scheduler, $Email success.."
    :log info "Sending e-mail process...complete."
    #---------------------------------------------------------------------------------------------
    #----Deleting-Deleting----
    #-----deleting file created before----
    :delay 120s
    :if ([:len [/file find name=$SysAll]] > 0) do={/file remove $SysAll}
    :if ([:len [/file find name=$Mangle]] > 0) do={/file remove $Mangle}
    :if ([:len [/file find name=$Queue]] > 0) do={/file remove $Queue}
    :if ([:len [/file find name=$Firewall]] > 0) do={/file remove $Firewall}
    :if ([:len [/file find name=$Script]] > 0) do={/file remove $Script}
    :if ([:len [/file find name=$Scheduler]] > 0) do={/file remove $Scheduler}
    :if ([:len [/file find name=$Email]] > 0) do={/file remove $Email}
    :log info "Deleting file $SysAll, $Mangle, $Queue, $Firewall, $Script, $Scheduler, $Email success.."
    Bila script diatas dijalankan, maka sistem akan melakukan backup sistem keseluruhan, dengan nama sysAll, Mangle, Queue, FIrewall, Script, Scheduler, dan email sesuai dengan board name, dan versi Mikrotik, serta tanggal backupnya, kemudian akan mengirimkannya melalui email. yah, sesederhana itu.
    untuk waktu eksekusinya, kita dapat membuat scheduler seperti berikut :

    Code:
    add disabled=no interval=3d name=EmailBackupRsc on-event=EmailBackupRsc policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api start-date=sep/07/2011 \
        start-time=00:00:00
    Scheduler akan dijalankan dengan interval waktu setiap 3hari.

    NOTE

    Demikian, script simple dari cw-12, script ini sederhana tapi sudah di coba dibeberapa versi, terakhir dipakai di versi 5.7 masih berfungsi dengan baik, kita juga bisa menambahkan script untuk mengirim sms pada akhir script tersebut ketika email sudah berhasil dikirimkan.

    seperti biasa, hargai tulisan orang, walau itu tulisan yang sangat sederhana dari seorang nubie kek saya sekalipun, dan kalau ada yang klik thanks, saya tidak akan menolaknya. Click here to enlarge salam.
    Click here to enlarge
    Last edited by cw-12; 03-10-2011 at 18:11. Reason: tambahin ip smtp.

  2. The Following 30 Users Say Thank You to cw-12 For This Useful Post:

    + Show/Hide list of the thanked


  3. #2
    Status
    Offline
    zdienos's Avatar
    Forum Guru
    Join Date
    Feb 2010
    Location
    ~/makasar
    Posts
    1,252
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    trims sharingnya mas bro !!

    keknya bisa dicoba nih buat backup database usermanager... Click here to enlarge

  4. #3
    Status
    Offline
    cw-12's Avatar
    Member Senior
    Join Date
    Jan 2010
    Posts
    391
    Reviews
    Read 0 Reviews
    Downloads
    5
    Uploads
    2
    Feedback Score
    0
    Click here to enlarge Originally Posted by zdienos Click here to enlarge
    trims sharingnya mas bro !!

    keknya bisa dicoba nih buat backup database usermanager... Click here to enlarge
    silahkan gan, itu script udah di bikin se universal mungkin, tinggal ubah-ubah dikit, jadi deh. jangan lupa share lagi dimari.Click here to enlarge

  5. #4
    Status
    Offline
    mrengestik's Avatar
    Newbie
    Join Date
    Mar 2008
    Posts
    46
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    mantap sharingnya bro, kmarin bingung2 cari ip nya google buat smtp. maknyuss. cendol meluncur Click here to enlarge

  6. #5
    Status
    Offline
    aanchoto's Avatar
    Calon Member
    Join Date
    Nov 2008
    Location
    Bukittinggi
    Posts
    76
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    Terima Kasih Sharingnya Om,,,
    Click here to enlarge

  7. #6
    Status
    Offline
    cw-12's Avatar
    Member Senior
    Join Date
    Jan 2010
    Posts
    391
    Reviews
    Read 0 Reviews
    Downloads
    5
    Uploads
    2
    Feedback Score
    0
    Click here to enlarge Originally Posted by mrengestik Click here to enlarge
    mantap sharingnya bro, kmarin bingung2 cari ip nya google buat smtp. maknyuss. cendol meluncur Click here to enlarge
    thanks gan, cendolnya seger Click here to enlarge

    ---------- Post added at 17:14 ---------- Previous post was at 17:12 ----------

    Click here to enlarge Originally Posted by aanchoto Click here to enlarge
    Terima Kasih Sharingnya Om,,,
    Click here to enlarge
    sama2 gan, jangan lupa thanksnya (ih ngarep banget hihihi).

  8. #7
    Status
    Offline
    tyang_dusun's Avatar
    Member Super Senior
    Join Date
    Jun 2008
    Location
    Klaten, Jawa Tengah, Indonesia, Indonesia
    Posts
    521
    Reviews
    Read 0 Reviews
    Downloads
    1
    Uploads
    0
    Feedback Score
    0
    Berhasil ...... Berhasil ...... Berhasil ...... Horeeee .... Click here to enlarge



    di V 3.30 kok g bisa Gan ........ Click here to enlarge

    tlong scriptnya Gan gmn ?
    Last edited by tyang_dusun; 29-09-2011 at 16:57.

  9. #8
    Status
    Offline
    cw-12's Avatar
    Member Senior
    Join Date
    Jan 2010
    Posts
    391
    Reviews
    Read 0 Reviews
    Downloads
    5
    Uploads
    2
    Feedback Score
    0
    Click here to enlarge Originally Posted by tyang_dusun Click here to enlarge
    Berhasil ...... Berhasil ...... Berhasil ...... Horeeee .... Click here to enlarge



    di V 3.30 kok g bisa Gan ........ Click here to enlarge

    tlong scriptnya Gan gmn ?
    belum pernah coba di v.3.30 gan..Click here to enlarge

  10. #9
    Status
    Offline
    chabyiolue's Avatar
    Member
    Join Date
    Feb 2010
    Posts
    228
    Reviews
    Read 0 Reviews
    Downloads
    9
    Uploads
    0
    Feedback Score
    0
    coba dulo OM ... maksih

  11. #10
    Status
    Offline
    allcos2000's Avatar
    Baru Gabung
    Join Date
    Mar 2010
    Posts
    2
    Reviews
    Read 0 Reviews
    Downloads
    4
    Uploads
    0
    Feedback Score
    0
    [xxx@RouterOnePde] > /tool e-mail pr
    address: 74.125.39.109
    port: 25
    from: [GANTI-DENGAN-ALAMAT-EMAIL-ANDA]
    user: [GANTI-DENGAN-ALAMAT-EMAIL-ANDA]
    password: [GANTI-DENGAN-PASSWORD-EMAIL-ANDA]
    [xxx@RouterOnePde] >

    Maaf address (dibold) yang di dapat dari mana gan, maaf baru nih..... he he he

  12. The Following User Says Thank You to allcos2000 For This Useful Post:


  13. #11
    Status
    Offline
    cw-12's Avatar
    Member Senior
    Join Date
    Jan 2010
    Posts
    391
    Reviews
    Read 0 Reviews
    Downloads
    5
    Uploads
    2
    Feedback Score
    0
    itu punya google, bisa diliat dengan menggunakan nslookup smtp.gmail.com, selain ip itu bisa juga dengan ip smtp gmail yang lain spt :
    74.125.127.108
    74.125.127.109
    dicoba ajah satu-satu yang bisa dipake.

  14. The Following User Says Thank You to cw-12 For This Useful Post:


  15. #12
    Status
    Offline
    tyang_dusun's Avatar
    Member Super Senior
    Join Date
    Jun 2008
    Location
    Klaten, Jawa Tengah, Indonesia, Indonesia
    Posts
    521
    Reviews
    Read 0 Reviews
    Downloads
    1
    Uploads
    0
    Feedback Score
    0
    Mo nanya :

    Mikrotik Versi berapa aj yg support unt script ini...???

    yg pasti ane brhasil di V RB 450 V 4.11

    untuk yg V 3.30 lom isa euy ...... Click here to enlarge

    bt rekan2 yg udh bisa buat V 3.30 tlong di share y Gan ....?!!

  16. #13
    Status
    Offline
    m4l41k4t_p3n454r4n's Avatar
    Member
    Join Date
    Jun 2009
    Posts
    212
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    Click here to enlarge Originally Posted by tyang_dusun Click here to enlarge
    Mo nanya :

    Mikrotik Versi berapa aj yg support unt script ini...???

    yg pasti ane brhasil di V RB 450 V 4.11

    untuk yg V 3.30 lom isa euy ...... Click here to enlarge

    bt rekan2 yg udh bisa buat V 3.30 tlong di share y Gan ....?!!

    kalo di tempat w semua versi support gan mungkin jika di tempat agan ga jln tinggal coba cek scriptnya saja dan sesuaikan commandnya saja.
    atau bisa coba juga scrript dibawah trus tinggal buat scheduler setiap berapa hari dikirim backup ke email.
    script :
    /system backup save name=("Backup - " . [/system identity get name] . "-" . [: pick [/system clock get date] 7 11] . [: pick [/system clock get date] 0 3] . [: pick [/system clock get date] 4 6]); /tool e-mail send to="backup@coba.com" from="backup@coba.com" server="IP mailserver" subject=([/system identity get name] . " Backup " . [/system clock get date] . "-" . [/system clock get time]) file=("Backup - " . [/system identity get name] . "-" . [: pick [/system clock get date] 7 11] . [: pick [/system clock get date] 0 3] . [: pick [/system clock get date] 4 6] . ".backup"); :delay 10; /file rem [/file find name=("Backup - " . [/system identity get name] . "-" . [: pick [/system clock get date] 7 11] . [: pick [/system clock get date] 0 3] . [: pick [/system clock get date] 4 6] . ".backup")]; :log info ("System Backup emailed at " . [/sys cl get time] . " " . [/sys cl get date])

    Note : command ": pick" antara titik dua dan pick ga ada spasi di sini w kasih spani karena berubah jadi emoticon.

    schedule backup :
    add comment="script backup" disabled=no interval=1d name=sched_backup_email \
    on-event=ebackup start-date=sep/12/2007 start-time=05:30:00
    Last edited by m4l41k4t_p3n454r4n; 04-10-2011 at 00:36.

  17. The Following User Says Thank You to m4l41k4t_p3n454r4n For This Useful Post:


  18. #14
    Status
    Offline
    tyang_dusun's Avatar
    Member Super Senior
    Join Date
    Jun 2008
    Location
    Klaten, Jawa Tengah, Indonesia, Indonesia
    Posts
    521
    Reviews
    Read 0 Reviews
    Downloads
    1
    Uploads
    0
    Feedback Score
    0
    Click here to enlarge Originally Posted by m4l41k4t_p3n454r4n Click here to enlarge
    kalo di tempat w semua versi support gan mungkin jika di tempat agan ga jln tinggal coba cek scriptnya saja dan sesuaikan commandnya saja.
    atau bisa coba juga scrript dibawah trus tinggal buat scheduler setiap berapa hari dikirim backup ke email.
    script :
    /system backup save name=("Backup - " . [/system identity get name] . "-" . [: pick [/system clock get date] 7 11] . [: pick [/system clock get date] 0 3] . [: pick [/system clock get date] 4 6]); /tool e-mail send to="backup@coba.com" from="backup@coba.com" server="IP mailserver" subject=([/system identity get name] . " Backup " . [/system clock get date] . "-" . [/system clock get time]) file=("Backup - " . [/system identity get name] . "-" . [: pick [/system clock get date] 7 11] . [: pick [/system clock get date] 0 3] . [: pick [/system clock get date] 4 6] . ".backup"); :delay 10; /file rem [/file find name=("Backup - " . [/system identity get name] . "-" . [: pick [/system clock get date] 7 11] . [: pick [/system clock get date] 0 3] . [: pick [/system clock get date] 4 6] . ".backup")]; :log info ("System Backup emailed at " . [/sys cl get time] . " " . [/sys cl get date])

    Note : command ": pick" antara titik dua dan pick ga ada spasi di sini w kasih spani karena berubah jadi emoticon.

    schedule backup :
    add comment="script backup" disabled=no interval=1d name=sched_backup_email \
    on-event=ebackup start-date=sep/12/2007 start-time=05:30:00

    lom bisa euy Gan ...

    mnta ptunjuknya yg lbih jlas dunk ...Click here to enlarge

  19. #15
    Status
    Offline
    m4l41k4t_p3n454r4n's Avatar
    Member
    Join Date
    Jun 2009
    Posts
    212
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    ga bisa na gmn gan, dan itu jgn lupa dirubah backup@coba.com dgn emailnya agan trus IP server juga disesuaikan gan.
    Trus coba run Script gan lalu liat di file ada muncul file backupnya ga kalo ga ada berarti script yg agan input ada yg kurang tepat.

  20. The Following User Says Thank You to m4l41k4t_p3n454r4n For This Useful Post:


 

 
Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help ... Cara membuat Backup settingan Mikrotik
    By nunukan in forum Beginner Basics
    Replies: 34
    Last Post: 19-10-2011, 18:35
  2. backup and restore konfigurasi di mikrotik router??
    By sipiyuku in forum General Networking
    Replies: 26
    Last Post: 07-10-2011, 14:45
  3. [SHARE] send email dengan gmail
    By anazh12 in forum Scripting @ Mikrotik
    Replies: 20
    Last Post: 25-06-2011, 01:16
  4. Backup Mikrotik Otomatis via email..
    By lamno in forum Scripting @ Mikrotik
    Replies: 14
    Last Post: 14-04-2011, 09:10
  5. [ ask ] cara setting konfigurasi mikrotik
    By gusti39 in forum Beginner Basics
    Replies: 2
    Last Post: 16-05-2010, 19:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •