SlideShare a Scribd company logo
Auto Backup RouterOS
with FTP Server (Linux)
EEN PAHLEFI,S.KOM
Agenda
1. Profile
2. Introduction
3. Solusi dan Goal
4. Demo Live
Profil
Nama : Een Pahlefi,S.Kom
Base : Solok, (Sumatra Barat), Duri (Riau), Banjarmasin (Kalsel)
MikroTik Certified : MTCINE
Profesi : Penulis Ebook, NOC, Freelancer
Website Pribadi : http://eenpahlefi-banjarmasin.blogspot.co.id
Website Komersil : http://ebook-suneo.web.id
Email : eenpahlefi@cinox.co.id or 0812-5835-3133 (WhatsApp or Telegram)
Apa itu Scripting RouterOS
Scripting di RouterOS > Teknik yang digunakan untuk meng-otomatisasi perintah.
Scripting di RouterOS > Teknik penulisan nya mirip seperti bahasa pemprograman.
Scripting di RouterOS > Bukan Bahasa Pemprograman.
Scripting di RouterOS > Bisa dijalankan berdasarkan event.
Dasar Bahasa Pemprograman
•Variabel
•Operator Aritmatika
•True and False (Benar dan Salah)
•For dan While (Perulangan)
•Kondisi (Pernyataan Bersyarat)
Variabel Local dan Global
Source : https://doexploit.medium.com/pembahasan-mendasar-mikrotik-scripting-43f59be44464
Operator Aritmatika
Source : https://doexploit.medium.com/pembahasan-mendasar-mikrotik-scripting-43f59be44464
True and False (Benar dan Salah)
Source : https://doexploit.medium.com/pembahasan-mendasar-mikrotik-scripting-43f59be44464
Kondisi (Pernyataan Bersyarat)
Perulangan
Source : https://oprekerit.wordpress.com/2017/04/27/penjadwalan-manajemen-bandwidth-di-routeros-dengan-scripting-dan-scheduling/
Contoh Scripting (1)
Hapus seluruh address-list
Contoh Scripting (2)
Hapus rule filter berdasarkan comment
Scripting vs Bahasa Pemprograman
•MikroTik Scripting menjalankan kodenya baris perbaris (Interpreter).
•Bahasa pemrograman dijalankan secara keseluruhan langsung melalui compiler.
Scripting
PHP (Hypertext Preprocessor)
HTML (Hypertext Markup Language)
CSS (Cascading Style Sheets)
Bash (Unix dan Linux)
Python
Bahasa Pemprograman
Bahasa C
Pascal
Java
Scripting Router dengan Event
Script berjalan otomatis ketika ada event pppoe login atau logout
Gedung Cyber (Data Center Terbakar)
Tradisional
1. Backup File
2. Download dan disimpan di Flashdisk/Hardisk
Router Mencapai Ratusan
Solusi dan Goal
1. Gunakan Scripting RouterOS
2. Simpan File Backup Secara Terjadwal
3. Penyimpanan FTP Server Secara Terpusat
Setup FTP Server
1. Windows Server
2. Keluarga Linux/Unix
3. RouterOS (FTP Server)
FTP Server di Ubuntu 20.04
1. Setup FTP Server VSFTPD (Very Secure File Transfer Protocol Daemon) *WAJIB
2.Create Account Username dan Password FTP Server *WAJIB
3.Set Permission (Write) FTP Server *WAJIB
4.Set Firewall FTP Server *OPSI
Link : http://shorturl.at/dACPY
FTP Server
Alamat IP : 103.84.209.138
Port : 21
Username : eenpahlefi
Password : eenpahlefi
Direktori FTP Server : /home/eenpahlefi
Prepare and Configure Router
1. Router berhasil berkomunikasi dan bertukar data dengan FTP Server *WAJIB
2. Hak akses router full *WAJIB
2. Set NTP Client *WAJIB
2. Set Clock and Date *WAJIB
3. Create Scripts .backup and .rsc
*WAJIB
Set NTP Client
server 0.id.pool.ntp.org
server 1.id.pool.ntp.org
server 2.id.pool.ntp.org
server 3.id.pool.ntp.org
Set Clock and Date
Create Scripts and Scheduler
System > Scheduler
Scripts Auto Backup
:local nama "$[/system identity get name]";
/system backup save name=$nama;
/tool fetch address=103.84.209.138 src-path="/$nama.backup" user=eenpahlefi
password="eenpahlefi" dst-path="$nama.backup" port=21 mode=ftp upload=yes;
/export file=$nama;
/tool fetch address=103.84.209.138 src-path="/$nama.rsc" user=eenpahlefi
password="eenpahlefi" dst-path="$nama.rsc" port=21 mode=ftp upload=yes;
Log fetch berhasil di upload
File .backup dan .rsc berhasil di upload
Tool Fetch :
Source : https://citraweb.com/artikel_lihat.php?id=373
FTP Server Menggunakan RouterOS
1. Router berhasil berkomunikasi dan bertukar data dengan FTP Server *WAJIB
2. Hak akses router full *WAJIB
3. Penyimpanan disk mencukupi *WAJIB
4. Service FTP di ijinkan *WAJIB
Notifikasi with Telegram *optional
/tool fetch
url="https://api.telegram.org/bot880755591:AAE0wDOA5jR9LOYTdPgJM6ouS_P525Q1_2s/sen
dMessage?chat_id=-374182174&text=File Backup $nama Berhasil di Kirim ke Server
(103.84.209.138)" keep-result=no;
Notifikasi with Telegram *optional
Crontab
Cron daemon merupakan sebuah service yang berjalan di semua distribusi Unix dan
Linux.
Service ini didesain khususnya untuk mengeksekusi suatu perintah diwaktu-waktu
tertentu yang telah ditentukan.
Sering juga disebut cronjobs di kalangan system administrator.
Source : https://www.codepolitan.com/memahami-perintah-perintah-crontab-paling-lengkap-59f69445130a0
Versi RouterOS Versi Linux
Kompresi Data with tar gz
Terdiri dari dua proses, yaitu menggabungkan file (tar) dan kemudian melakukan kompresi
(gzip).
Karena yang dikompres adalah hasil penggabungan file, maka ukuran file hasil kompresi menjadi
lebih kecil. Akan tetapi, walau hanya ingin mengakses satu file, kita harus mendekompres
seluruhnya.
Dengan metode ini, disimpan atribut-atribut Unix untuk semua file dan folder. Oleh karena itu,
direkomendasikan untuk digunakan oleh pengguna sistem operasi Unix-like (seperti Linux, Mac,
dsb).
Source : https://id.quora.com/Apa-keunggulan-sistem-kompresi-tar-gz-dibandingkan-zip-atau-rar
#dpkg-reconfigure tzdata
Scripting Crontab di Linux Part 1
#dpkg-reconfigure tzdata
#mkdir /home/databackup-rsc
#tar -czvf /home/databackup-rsc/"archive-$(date +"%Y-%m-%d").tar.gz"
/home/eenpahlefi/
#cd /home/databackup-rsc
#nano auto-backup.sh
#!/bin/sh
tar -czvf /home/databackup-rsc/"archive-$(date +"%Y-%m-%d").tar.gz" /home/eenpahlefi/
Source : https://eenpahlefi-banjarmasin.blogspot.com/2022/01/cara-membuat-auto-backup-file-tar-gz-di-ubuntu-20.04.html
Scripting Crontab di Linux Part 2
#chmod 755 auto-backup.sh
#crontab –e
0 0 * * * /home/databackup-rsc/auto-backup.sh
Hasil File Auto Backup tar gz
1. Lancarkan dan wajib paham configurasi routeros secara tepat.
2. Berlatih di command line interface (CLI) di RouterOS.
3. Belajar dasar atau fundamental Bahasa pemprograman.
4. Sering ber-imajinasi dan meng-otomatisasikan pekerjaan yang berulang.
Tips Jago Scripting
Demo
1. Download scripts : http://shorturl.at/ewIJX
2. Gunakan FileZilla/Winscp untuk melihat hasil .backup dan .rsc
---------------------------------------------------------------------------------------------------------------
Alamat IP : 103.84.209.138
Username : eenpahlefi
Password : eenpahlefi
Port : 21
---------------------------------------------------------------------------------------------------------------

More Related Content

Similar to Automatic Backup via FTP - Part 2 (10)

PPT
presentasi-backup.ppt
Efrizal Zaida
 
PDF
Pembahasan soal paket 1
Ygrex Thebygdanns
 
PPT
Rizki tugas produktif tkj
rizkijunot
 
DOCX
Makalah jarkom
laila limariantika, SPd
 
PPT
bakup.ppt
Efrizal Zaida
 
DOC
Konfigurasi pc server dan pc route6r pada lks nasional xiii jakarta tahun 201...
slempase
 
DOCX
Tutorial instalasi ubuntu server 12.04, setting DNS server dan Web server
WireThic, Electronic and Computing Program
 
PDF
Workshop & pelatihan
Zerokid Zerokid
 
PDF
Sysadmin Jaringan Linux Server
Gun Gun Gunawan
 
PDF
FreeBSD FTP Server
Telkom Institute of Management
 
presentasi-backup.ppt
Efrizal Zaida
 
Pembahasan soal paket 1
Ygrex Thebygdanns
 
Rizki tugas produktif tkj
rizkijunot
 
Makalah jarkom
laila limariantika, SPd
 
bakup.ppt
Efrizal Zaida
 
Konfigurasi pc server dan pc route6r pada lks nasional xiii jakarta tahun 201...
slempase
 
Tutorial instalasi ubuntu server 12.04, setting DNS server dan Web server
WireThic, Electronic and Computing Program
 
Workshop & pelatihan
Zerokid Zerokid
 
Sysadmin Jaringan Linux Server
Gun Gun Gunawan
 
FreeBSD FTP Server
Telkom Institute of Management
 

More from GLC Networks (20)

PDF
Firewall mangle PBR: steering outbound path similar to inbound
GLC Networks
 
PDF
Internal BGP tuning: Mesh peering to avoid loop
GLC Networks
 
PDF
BGP tuning: Peer with loopback
GLC Networks
 
PDF
BGP security tuning: pull-up route
GLC Networks
 
PDF
BGP troubleshooting: route origin
GLC Networks
 
PDF
Steering traffic in OSPF: Interface cost
GLC Networks
 
PDF
Tuning OSPF: Bidirectional Forwarding Detection (BFD)
GLC Networks
 
PDF
Tuning OSPF: Prefix Aggregate
GLC Networks
 
PDF
Tuning OSPF: area hierarchy, LSA, and area type
GLC Networks
 
PDF
Stable OSPF: choosing network type.pdf
GLC Networks
 
PDF
Controlling Access Between Devices in the same Layer 2 Segment
GLC Networks
 
PDF
GIT as Mikrotik Configuration Management
GLC Networks
 
PDF
RouterOS Migration From v6 to v7
GLC Networks
 
PDF
Building a Web Server with NGINX
GLC Networks
 
PDF
Best Current Practice (BCP) 38 Ingress Filtering for Security
GLC Networks
 
PDF
EOIP Deep Dive
GLC Networks
 
PDF
Policy Based Routing with Indirect BGP - Part 2
GLC Networks
 
PDF
Policy Based Routing with Indirect BGP - Part 1
GLC Networks
 
PDF
Internet Protocol Deep-Dive
GLC Networks
 
PDF
Network Monitoring with The Dude and Whatsapp
GLC Networks
 
Firewall mangle PBR: steering outbound path similar to inbound
GLC Networks
 
Internal BGP tuning: Mesh peering to avoid loop
GLC Networks
 
BGP tuning: Peer with loopback
GLC Networks
 
BGP security tuning: pull-up route
GLC Networks
 
BGP troubleshooting: route origin
GLC Networks
 
Steering traffic in OSPF: Interface cost
GLC Networks
 
Tuning OSPF: Bidirectional Forwarding Detection (BFD)
GLC Networks
 
Tuning OSPF: Prefix Aggregate
GLC Networks
 
Tuning OSPF: area hierarchy, LSA, and area type
GLC Networks
 
Stable OSPF: choosing network type.pdf
GLC Networks
 
Controlling Access Between Devices in the same Layer 2 Segment
GLC Networks
 
GIT as Mikrotik Configuration Management
GLC Networks
 
RouterOS Migration From v6 to v7
GLC Networks
 
Building a Web Server with NGINX
GLC Networks
 
Best Current Practice (BCP) 38 Ingress Filtering for Security
GLC Networks
 
EOIP Deep Dive
GLC Networks
 
Policy Based Routing with Indirect BGP - Part 2
GLC Networks
 
Policy Based Routing with Indirect BGP - Part 1
GLC Networks
 
Internet Protocol Deep-Dive
GLC Networks
 
Network Monitoring with The Dude and Whatsapp
GLC Networks
 
Ad

Recently uploaded (9)

PPTX
3.1.2 Menetukan spesifikasi Hardware Server yang dibutuhkan.pptx
adellaritmawati41
 
PDF
Materi Presantasi Topologi-Jaringan-1.pdf
yusayuliansyah67
 
PDF
peta konsep keterbatasan fasilitas koding
ErvinaAriyanti1
 
PPTX
3.1.3 Menentukan cara instalasi sistem operasi.pptx
adellaritmawati41
 
PPTX
Materi informatika Analisis Data kelas 9
dwiambalaziz
 
PDF
Pengaruh lem kertas terhadap penurunan dan peningkatan kekuatan bahan materia...
FreddyTaebenu
 
PDF
Peran Artificial Intelligence sebagai Force Multiplier dalam Network-Centric ...
sprgirllsasa
 
PPTX
Cara mengoperasikan radio amatir bagi para pemula
muhmukhtar53
 
PPTX
cara mengoperasikan drone bagi para pemula
muhmukhtar53
 
3.1.2 Menetukan spesifikasi Hardware Server yang dibutuhkan.pptx
adellaritmawati41
 
Materi Presantasi Topologi-Jaringan-1.pdf
yusayuliansyah67
 
peta konsep keterbatasan fasilitas koding
ErvinaAriyanti1
 
3.1.3 Menentukan cara instalasi sistem operasi.pptx
adellaritmawati41
 
Materi informatika Analisis Data kelas 9
dwiambalaziz
 
Pengaruh lem kertas terhadap penurunan dan peningkatan kekuatan bahan materia...
FreddyTaebenu
 
Peran Artificial Intelligence sebagai Force Multiplier dalam Network-Centric ...
sprgirllsasa
 
Cara mengoperasikan radio amatir bagi para pemula
muhmukhtar53
 
cara mengoperasikan drone bagi para pemula
muhmukhtar53
 
Ad

Automatic Backup via FTP - Part 2

  • 1. Auto Backup RouterOS with FTP Server (Linux) EEN PAHLEFI,S.KOM
  • 2. Agenda 1. Profile 2. Introduction 3. Solusi dan Goal 4. Demo Live
  • 3. Profil Nama : Een Pahlefi,S.Kom Base : Solok, (Sumatra Barat), Duri (Riau), Banjarmasin (Kalsel) MikroTik Certified : MTCINE Profesi : Penulis Ebook, NOC, Freelancer Website Pribadi : http://eenpahlefi-banjarmasin.blogspot.co.id Website Komersil : http://ebook-suneo.web.id Email : [email protected] or 0812-5835-3133 (WhatsApp or Telegram)
  • 4. Apa itu Scripting RouterOS Scripting di RouterOS > Teknik yang digunakan untuk meng-otomatisasi perintah. Scripting di RouterOS > Teknik penulisan nya mirip seperti bahasa pemprograman. Scripting di RouterOS > Bukan Bahasa Pemprograman. Scripting di RouterOS > Bisa dijalankan berdasarkan event.
  • 5. Dasar Bahasa Pemprograman •Variabel •Operator Aritmatika •True and False (Benar dan Salah) •For dan While (Perulangan) •Kondisi (Pernyataan Bersyarat)
  • 6. Variabel Local dan Global Source : https://doexploit.medium.com/pembahasan-mendasar-mikrotik-scripting-43f59be44464
  • 7. Operator Aritmatika Source : https://doexploit.medium.com/pembahasan-mendasar-mikrotik-scripting-43f59be44464
  • 8. True and False (Benar dan Salah) Source : https://doexploit.medium.com/pembahasan-mendasar-mikrotik-scripting-43f59be44464
  • 11. Contoh Scripting (1) Hapus seluruh address-list
  • 12. Contoh Scripting (2) Hapus rule filter berdasarkan comment
  • 13. Scripting vs Bahasa Pemprograman •MikroTik Scripting menjalankan kodenya baris perbaris (Interpreter). •Bahasa pemrograman dijalankan secara keseluruhan langsung melalui compiler. Scripting PHP (Hypertext Preprocessor) HTML (Hypertext Markup Language) CSS (Cascading Style Sheets) Bash (Unix dan Linux) Python Bahasa Pemprograman Bahasa C Pascal Java
  • 14. Scripting Router dengan Event Script berjalan otomatis ketika ada event pppoe login atau logout
  • 15. Gedung Cyber (Data Center Terbakar)
  • 16. Tradisional 1. Backup File 2. Download dan disimpan di Flashdisk/Hardisk
  • 18. Solusi dan Goal 1. Gunakan Scripting RouterOS 2. Simpan File Backup Secara Terjadwal 3. Penyimpanan FTP Server Secara Terpusat
  • 19. Setup FTP Server 1. Windows Server 2. Keluarga Linux/Unix 3. RouterOS (FTP Server)
  • 20. FTP Server di Ubuntu 20.04 1. Setup FTP Server VSFTPD (Very Secure File Transfer Protocol Daemon) *WAJIB 2.Create Account Username dan Password FTP Server *WAJIB 3.Set Permission (Write) FTP Server *WAJIB 4.Set Firewall FTP Server *OPSI Link : http://shorturl.at/dACPY
  • 21. FTP Server Alamat IP : 103.84.209.138 Port : 21 Username : eenpahlefi Password : eenpahlefi Direktori FTP Server : /home/eenpahlefi
  • 22. Prepare and Configure Router 1. Router berhasil berkomunikasi dan bertukar data dengan FTP Server *WAJIB 2. Hak akses router full *WAJIB 2. Set NTP Client *WAJIB 2. Set Clock and Date *WAJIB 3. Create Scripts .backup and .rsc *WAJIB
  • 23. Set NTP Client server 0.id.pool.ntp.org server 1.id.pool.ntp.org server 2.id.pool.ntp.org server 3.id.pool.ntp.org
  • 25. Create Scripts and Scheduler
  • 27. Scripts Auto Backup :local nama "$[/system identity get name]"; /system backup save name=$nama; /tool fetch address=103.84.209.138 src-path="/$nama.backup" user=eenpahlefi password="eenpahlefi" dst-path="$nama.backup" port=21 mode=ftp upload=yes; /export file=$nama; /tool fetch address=103.84.209.138 src-path="/$nama.rsc" user=eenpahlefi password="eenpahlefi" dst-path="$nama.rsc" port=21 mode=ftp upload=yes;
  • 28. Log fetch berhasil di upload
  • 29. File .backup dan .rsc berhasil di upload
  • 30. Tool Fetch : Source : https://citraweb.com/artikel_lihat.php?id=373
  • 31. FTP Server Menggunakan RouterOS 1. Router berhasil berkomunikasi dan bertukar data dengan FTP Server *WAJIB 2. Hak akses router full *WAJIB 3. Penyimpanan disk mencukupi *WAJIB 4. Service FTP di ijinkan *WAJIB
  • 32. Notifikasi with Telegram *optional /tool fetch url="https://api.telegram.org/bot880755591:AAE0wDOA5jR9LOYTdPgJM6ouS_P525Q1_2s/sen dMessage?chat_id=-374182174&text=File Backup $nama Berhasil di Kirim ke Server (103.84.209.138)" keep-result=no;
  • 34. Crontab Cron daemon merupakan sebuah service yang berjalan di semua distribusi Unix dan Linux. Service ini didesain khususnya untuk mengeksekusi suatu perintah diwaktu-waktu tertentu yang telah ditentukan. Sering juga disebut cronjobs di kalangan system administrator. Source : https://www.codepolitan.com/memahami-perintah-perintah-crontab-paling-lengkap-59f69445130a0 Versi RouterOS Versi Linux
  • 35. Kompresi Data with tar gz Terdiri dari dua proses, yaitu menggabungkan file (tar) dan kemudian melakukan kompresi (gzip). Karena yang dikompres adalah hasil penggabungan file, maka ukuran file hasil kompresi menjadi lebih kecil. Akan tetapi, walau hanya ingin mengakses satu file, kita harus mendekompres seluruhnya. Dengan metode ini, disimpan atribut-atribut Unix untuk semua file dan folder. Oleh karena itu, direkomendasikan untuk digunakan oleh pengguna sistem operasi Unix-like (seperti Linux, Mac, dsb). Source : https://id.quora.com/Apa-keunggulan-sistem-kompresi-tar-gz-dibandingkan-zip-atau-rar
  • 37. Scripting Crontab di Linux Part 1 #dpkg-reconfigure tzdata #mkdir /home/databackup-rsc #tar -czvf /home/databackup-rsc/"archive-$(date +"%Y-%m-%d").tar.gz" /home/eenpahlefi/ #cd /home/databackup-rsc #nano auto-backup.sh #!/bin/sh tar -czvf /home/databackup-rsc/"archive-$(date +"%Y-%m-%d").tar.gz" /home/eenpahlefi/ Source : https://eenpahlefi-banjarmasin.blogspot.com/2022/01/cara-membuat-auto-backup-file-tar-gz-di-ubuntu-20.04.html
  • 38. Scripting Crontab di Linux Part 2 #chmod 755 auto-backup.sh #crontab –e 0 0 * * * /home/databackup-rsc/auto-backup.sh
  • 39. Hasil File Auto Backup tar gz
  • 40. 1. Lancarkan dan wajib paham configurasi routeros secara tepat. 2. Berlatih di command line interface (CLI) di RouterOS. 3. Belajar dasar atau fundamental Bahasa pemprograman. 4. Sering ber-imajinasi dan meng-otomatisasikan pekerjaan yang berulang. Tips Jago Scripting
  • 41. Demo 1. Download scripts : http://shorturl.at/ewIJX 2. Gunakan FileZilla/Winscp untuk melihat hasil .backup dan .rsc --------------------------------------------------------------------------------------------------------------- Alamat IP : 103.84.209.138 Username : eenpahlefi Password : eenpahlefi Port : 21 ---------------------------------------------------------------------------------------------------------------