GithubHelp home page GithubHelp logo

btfsfile's Introduction

BTFS

utk download menggunakan wget untuk menjalan file .sh menggunakan perintah $sh file.sh untuk menjalankan file .exp menggunakan perintah $expect file.exp

AUTOMATIC BACKUP FOLDER BTFS VIA SCP KE SERVER LAIN

LANGKAH:

  1. zipp file .btfs
  2. kirim ke server backup via scp
  3. metode diatas dibuat otomatis via crontab

PERSIAPAN:

  1. apt install expect
  2. apt-get install cron

download file autozip.sh:

wget https://raw.githubusercontent.com/sumarnodeflo/btfsfile/main/btfszipper.sh

CATATAN: Edit menggunakan NANO nama file *.zip

Menjalankan auto zip :

sh btfszipper.sh

download file autoscp.exp :

wget https://raw.githubusercontent.com/sumarnodeflo/btfsfile/main/autoscp.exp

CATATAN: Edit menggunakan NANO file *.exp rubah nama zip, user&IP dan juga ganti pasword server tujuan

Menjalankan autoscp.exp :

expect autoscp.exp

selain menggunakan autoscp.exp bisa juga menggunakan autoscp.sh :

download file autoscp.sh :

https://raw.githubusercontent.com/sumarnodeflo/btfsfile/main/autoscp.sh

CATATAN: Edit menggunakan NANO file *.sh rubah nama zip, user&IP dan juga ganti pasword server tujuan

Menjalankan script autoscp.sh :

sh autoscp.sh

edit crontab: crontab -e

0 22 * * 0-6 /root/btfszipper.sh
45 22 * * 0-6 /root/autoscp.exp

Mengubah hak akses pada filescript.sh:

chmod 755 btfszipper.sh
chmod 755 autoscp.sh
chmod 755 autoscp.exp

// atau bisa menggunakan script dibawah ini

sudo chmod +x btfszipper.sh
sudo chmod +x autoscp.sh
sudo chmod +x autoscp.exp

Lanjutkan hal yang sama untuk filescript.sh lainnya yang akan dijalankan pada cron job

PENGETAHUAN CRON JOB

install:

sudo apt-get install cron

Melihat daftar cron job:

crontab -l

input / Edit cron job:

crontab -e

Menghapus crontab:

crontab -r

Format:

* * * * * /home/sigit/script.sh

Keterangan waktu:

  1. (* pertama) : menit (isian : 0 – 59)
  2. (* kedua) : jam (isian : 0 – 23)
  3. (* ketiga) : hari dari bulan / tanggal (isian : 1 – 31)
  4. (* keempat) : bulan (isian : 1 – 12)
  5. (* kelima) : hari dari minggu (isian : 0 – 6) –> 0 = minggu

SETIAP MENIT

* * * * * php /opt/lampp/htdocs/jobs/test.php

SETIAP MINGGU HARI SABTU JAM 12 SIANG

0 12 * * 6 /home/sigit/script.sh

Eksekusi pada jam 9 malam setiap hari kerja (Senin – Jumat):

0 21 * * 1-5 /home/sigit/script.sh

btfsfile's People

Contributors

sumarnodeflo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.