Download as .zip Download as .tar.gz View on GitHub

Convention-over-configuration DAR backups


.-------------------.      .-------------.
| daily incremental |      |   weekly    |
| 001.00@007.00-inc |      | decremental |
|-------------------|      | 007.00-dec  |
| etc-T9@T7         |--.   |-------------|
| www-T9@T7         |  '-->| etc-T7      |<--.
|                   |      | www-T7      |   |
| etc-T8@T7         |      |             |   |
| www-T8@T7         |  .-->| etc-T0@T7   |---'
| ...               |  |   | www-T0@T7   |
| etc-T3@T0         |--'   '-------------'
| www-T3@T0         |

A dar-incdec repository (see example_repo in the distribution) consists of several folders, each corresponding to a backup interval (e.g. daily, weekly). Each interval folder contains multiple rules (e.g. back up /etc, /var/www). Each rule generates a backup series composed of multiple snapshots, distinguished by different suffixes (timestamps).

The name of interval folders should contain an interval (in days, possibly with decimals), an optional reference-interval specification (for incremental backups), and the backup mode (-inc or -dec). For example,

Backup rules are stored in a .backups subdirectory in each interval folder. Rules should be files with names like prefix[@ref].cfg, where prefix can contain alphanumeric characters and underscores (each prefix corresponds to a backup series). Rules can be symlinks and can be shared between the various interval directories. The optional @ref overrides the interval-wide reference directory, but to you shouldn't normally need this feature.

Each rule file contains dar arguments (the tree root -R, several -g paths), possibly preceded by --defaults= (which enables compression, except for some well-known non-compressible extensions). Do not include any dar flags related to incremental / decremental backup, as dar-incdec-repo adds these automatically.


darincdec_repo.py backup /path/to/repo

See example_repo in the distribution for a sample repository.

There is an auxiliary lower-level utility, darincdec_snapshot, which creates snapshots for a given series (prefix), operating within a single interval directory. Both utilities can be invoked with --help to learn more.


Copyright 2015 Dan A. Muresan

See LICENSE.txt for licensing information.