Code Monkey home page Code Monkey logo

rbu's Introduction

rbu - rolling backup

CircleCI Docker Pulls

rbu is a small shell script I created to backup files on a rolling basis (similar to syslog). rbu takes an input file and copies it to <filename>.1. If <filename>.1 already exists then it moves <filename>.1 to <filename>.2. It repeats this process untill a maximum number of backups (MAX_BACKUPS or -m) is reached. Once the max is reached it continues rolling the files.

By default rbu will not backup the file if the previous backup identically matches. This is to prevent numerous copies of the same backup. If you would like rbu to backup the file no matter what then you can supply the -a flag.

Install

Save rbu somewhere in your $PATH.

curl -LJ -o /usr/local/bin/rbu https://raw.githubusercontent.com/blockloop/rbu/master/rbu
chmod +x /usr/local/bin/rbu

Docker

docker run --rm -it blockloop/rbu -m 10 sqlite.db

Usage

Usage:
 rbu parameters file
 rbu [-d output_dir] [-m max_backups] [-a] <file>

Options:
 -d <dir>  The directory to write backups.
           Default: dirname of <file>
           Optionally use OUT_DIR environment variable
 -m <num>  Maximum number of backups to retain
           Default: 5
           Optionally use MAX_BACKUPS environment variable
 -a        Always perform backup regardless of change.
           Default: false
           Optionally use ALWAYS_BACKUP environment variable

 -h        display this help and exit

rbu's People

Contributors

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