Skip to content
/ rbu Public

tiny shell script to create rolling backups of files

Notifications You must be signed in to change notification settings

blockloop/rbu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

tiny shell script to create rolling backups of files

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published