Coder Social home page Coder Social logo

db-safe's Introduction

DB Safe

Egy ruby script ami a docker postgre adatbázisokról csinál automata backup-ot

Használat (Valszeg csak linuxon fog futni rendesen)

  1. bundle install
  2. bundle exec ruby db_backup.rb <options>

Options

  • --dry: Nem végez változtatás, csak ki printeli mit fog csinálni
  • --local: Nem tölti fel google drive-ra, csak a főkönyvtárba rakja a zip-et
  • --verbose: Logfájl helyett konzolba ír ki dolgokat

Konténer kihagyása

Ha egy konténerről nem kell beckup, a .dbignore fájlba írd be a nevét egy külön sorba

Env

A google-höz kell Service Account certificate. A fájl nevét a CERT_NAME-be rakd bele.

A cél mappa linkje a DRIVE_URL-be menjen bele. Példa a .env.example-ben

Cron job

Az automatikus ütemezéshez a whenever gem-et használja.

A config/schedule.rb fájlban lehet új ütemezést felvenni. A crontab frissítésére a bunlde exec whenever --update-crontab parancsot kell futtatni

Volume safe

Ha teljes volume-okat akarsz menteni, már azt is tud. Azokat menti automatikusan, amelyeken rajta van a "hu.kidev.dbsafe" címke. Mivel nem lehet már létező volume-ra újat rakni, azért van egy kis script ami megcsinálja helyetted

bundle exec ruby ./relabel_volume <volume_name> "hu.kirdev.dbsafe"

vagy ha ki akarod kapcsolni akkor

bundle exec ruby ./relabel_volume <volume_name>

db-safe's People

Contributors

bbucsy avatar

Watchers

 avatar  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.