sitarba
Sitarba is a simple backup tool to create full, differential or incremental tarballs of given file sets. Each backup belongs to an epoch (e.g. hour, day, week, month, year). Sitarba keeps for every epoch a configured number of backups.
Features:
- Full, differential and incremental backups.
- Restoring backups using tar. Afraid that backup creation did not work as expected? – Just have a look into the tarball!
- Cronjob friendly: automated decision on mode and epoch when creating backups and automatically pruning old backups. No need to manually decide which backup is to be pruned.
- User defined epochs to, e.g., to run a backup every other hour or on a biweekly basis.
- Exclude patterns for tar (globally, per file set, per epoch).
I use sitarba on my notebook in two ways:
-
I create a backup every week (differentially), every month (full) and every year of my notebook to an external USB hard drive.
-
Using a shell script, which is called by cron, and sshfs I create every hour (incrementally), every day (differentially) and every week (full) a backup of parts of my home directory that are stored on my office computer. In particular, for the hourly backups the thunderbird directory is excluded, as the mails reside on IMAP servers anyhow.
Usage
$ sitarba --help
sitarba - a simple backup solution.
Usage:
/usr/bin/sitarba {options} [cmd]
/usr/bin/sitarba --help
Commands:
backup make a new backup, if necessary
list list all backups (default)
prune prune outdated/old backups
Options:
-h, --help print this usage text
-c, --conf FILE use given configuration file
default: /etc/sitarba.conf
-e, --epoch EPOCH force to create backup for given epoch, which
can be 'sporadic' or one of the configured epochs
-m, --mode MODE override mode: full, diff, or incr
-v, --verbose be more verbose and interact with user
--verbosity LEVEL set verbosity to LEVEL, which can be
error, warning, info, debug
-V, --version print version info
A sample configuration file could like the following:
[global]
# Where sitarba stores the backups and other stuff
backupdir = /media/backup
# Which format should be used by tar?
# One of tar, tar.gz (default), tar.bz2, tar.xz
#format = tar.gz
# Path of the tar binary. (Default: /bin/tar)
#tarbin = /bin/tar
# Each option starting with "exclude" contains a single --exclude pattern for
# tar. Files matching the pattern are not included into the backup. Tar is
# invoked with "-C /" and, thus, exclude patterns refering to absolute paths
# need to start with "./" instead of "/".
exclude1 = */tmp/*
exclude2 = */*[Cc]ache/*
exclude3 = */log*
exclude4 = *.o
# Configure the epoch 'hour'. If left out no hourly backups are made. The
# epochs hour, day, week, month and year already define a timespan which cannot
# be overridden.
[epoch hour]
# The number of backups to keep for that epoch (positive integer)
numkeeps = 4
# The mode of this epoch. Can be one of 'full', 'diff', 'incr'. (Default: full)
mode = incr
# Each option starting with "exclude" defines an --exclude pattern for tar.
# These exclude patterns only apply to this epoch.
exclude1 = ./home/*/.thunderbird/*
# [epoch day]
# numkeeps = 14
# mode = diff
# [epoch week]
# numkeeps = 8
# mode = full
# [epoch month]
# numkeeps = 24
# mode = full
# [epoch year]
# numkeeps = 99
# mode = full
# Configure a user-defined epoch called 'biweek'.
[epoch biweek]
numkeeps = 13
mode = full
# The timespan of this epoch in the format 'UNIT' or 'INTEGER * UNIT',
# where INTEGER must be positive and UNIT must be one of 'hour', 'day',
# 'week', 'month', 'year'.
timespan = 2*week
# A file set called 'home'. Each file set is packed into one archive using tar.
[set home]
# Each option starting with "dir" contains a single directory which belongs to
# this file set.
dir1 = /home/username/
dir2 = /media/books/
# Each option starting with "exclude" defines an --exclude pattern for tar.
# These exclude patterns only apply to this file set.
exclude1 = ./home/*/media/*
[set conf]
dir1 = /etc/
Code
Sitarba is written in python and comes along with a man page. You can obtain the git repository or a tarball of the current source tree or of specific versions via git.sthu.org.
If you prefer direct links to tag’s archives you may use these:
Installation
Installation is done by simply calling in the source directory as a privileged user make install.