Giter VIP home page Giter VIP logo

bash-backup-rotation-script's Introduction

Bash Backup Rotation Script

Simple script which can be easily modified if needed for backup rotation. This script use ssh and rsync for syncing This script is completely rewriten , old script can be found here : https://github.com/todiadiyatmo/bash-backup-rotation-script/tree/legacy-1.0.0 .

Feature

  • Daily, Weekly, Monthly backup script with number of retention (backup to keep) option
  • backup to local only, local + remote and remote only mode
  • 4 different backup script :
    • file backup with zip compression script
    • rsync script
    • mysql script
    • mysql with extrabackup script
  • Secure backup with SSH connection

Todo

This release is still missing this feature from the old relesae

  • email notification

Usage

MySQL / MySQL Extrabackup / Zip File Backup

  • Copy script to desired location
  • Edit the parameter of the script, configure the BACKUP_RETENTION_ to set the rotation / number of backup needed
### User Pass Mysql ###
USER=backup
PASS=backup
DBNAME=project_sql
BACKUP_DIR="/root/backup"
DST_HOST="user@host"
REMOTE_DST_DIR="/root/backup"
BACKUP_DAILY=true # if set to false backup will not work
BACKUP_WEEKLY=true # if set to false backup will not work
BACKUP_MONTHLY=true # if set to false backup will not work
BACKUP_RETENTION_DAILY=3
BACKUP_RETENTION_WEEKLY=3
BACKUP_RETENTION_MONTHLY=3
  • test the script to make sure everything correct , ex : mysql-backup-script.sh
  • put script on cron to make sure it is running everyday at your desired time : 00 03 * * * backup.sh
  • check your backup result
  • profit :)

Pull request and issue

feel free to open pull request and submit bug ticket

bash-backup-rotation-script's People

Contributors

atryfox avatar clickwir avatar kujiy avatar mehmandarov avatar miketweaver avatar todiadiyatmo 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.