Commit Graph

633 Commits (719fb5fb7470df7f610fd190985765c71a2698e2)

Author SHA1 Message Date
Axel Burri 719fb5fb74 btrbk: bugfix: correct scheduling of "first weekly backup in month/year"
In the scheduler, a month (or year) does not start at the first day,
but at the first `preserve_day_of_week`. Make sure that all days
before `preserve_day_of_week` in a month get delta_months+1.

Example (corner case):
  - `preserve_day_of_week  sunday`
  - `target_preserve  *m`
  - no backups in 2018-02
  - backup with timestamp 2018-03-01 (which is a thursday)
  - backup with timestamp 2018-03-04 (which is a sunday)

Without this patch, because there are no sunday backups in 2018-02,
the first backup is considered a weekly (+4d after sunday), and as
such "first weekly of month 2018-03", and the second one is discarded.

With this patch, the first item is considered "first weekly of month
2018-02", and the second gets "first weekly of month 2018-03".

NOTE: This change may result in (previously preserved) backups to be
deleted!
2018-04-05 18:00:29 +02:00
Axel Burri e9c30e91fb documentation: btrbk.conf.5.asciidoc: enhance text on retention policy options 2018-04-05 18:00:29 +02:00
Axel Burri e4a0938712 btrbk: ignore "preserve_hour_of_day" on snapshots/backups having "timestamp_format=short"
Snapshots and backups having no exact time information (created with
"timestamp_format=short") are set to 00:00, which would be regarded as
"previous day" if preserve_hour_of_day is greater than 0. Fix this by
ignoring preserve_hour_of_day in this case.
2018-04-05 18:00:29 +02:00
Axel Burri c89ffd4213 btrbk: schedule: format preserve text only if needed
No functional changes, improves performance of schedule().
2018-04-05 18:00:24 +02:00
Thiodwitnir 5791d72171 btrbk: add "preserve_hour_of_day" configuration option
Introduces the new config option "preserve_hour_of_day" to specify
after what time backups should be considered as dailies.

Based on pull request #204, with changes:
 - calculation of weekly backups
 - change format of preserve_matrix
2018-04-05 16:37:31 +02:00
Axel Burri 951ae256fa btrbk: bump version to 0.27.0-dev 2018-04-05 16:26:57 +02:00
Axel Burri 1fd3a547df change version to 0.26.1; bump copyright year 2018-03-05 11:55:56 +01:00
Axel Burri 821e8bba6a add .gitattributes (export-ignore)
Effectively removes .gitignore files when using `git archive`.
2018-03-05 11:55:56 +01:00
Axel Burri 1cf004533c documentation: replace subvolid=0 with subvolid=5 2018-03-05 11:33:08 +01:00
Axel Burri 6f38536052 btrbk: set c_default for config keys with computed default
Suppress "Option redefined" warning for snapshot_name config option,
which has hardcoded (computed) default already set when checking.

fix regression: 0ebe2ea2e1
2018-02-26 16:06:12 +01:00
Axel Burri e75cf0c72c btrbk: fix exit status and transaction log when archive_exclude is set
Similar to ABORTED=USER_SKIP (active commandline filter), archives
having ABORTED=ARCHIVE_EXCLUDE_SKIP (active archive_exclude
configuration) do not cause exit status 10 and are hidden from
transaction log.
2018-02-26 14:35:26 +01:00
Axel Burri c0e0644eff btrbk.conf.example: add stream_buffer command to example config 2018-02-14 00:25:58 +01:00
Axel Burri 5651c96e4e btrbk: archive: always print "[-]" if no action was performed for target 2018-02-14 00:18:44 +01:00
Axel Burri 8610e75459 btrbk: add archive_exclude configuration option
Support wildcard characters, matches against both "$sroot->{PATH}" and
"$sroot->{PATH}/$snapshot_name".
2018-02-13 22:50:23 +01:00
Axel Burri 0ebe2ea2e1 btrbk: add "allow_multiple" flag for config_options declaration; use for option "group" 2018-02-13 19:30:24 +01:00
Axel Burri 3aaafa3d88 btrbk: add "meta" context for config defaults
Preparatory patch to allow multiple identical config keys in same
section.
2018-02-13 19:28:38 +01:00
Axel Burri b2b43cf199 btrbk: add configurable error_statement for check functions
Corrects error messages from --exclude option.
Applies to in check_file(), check_url() and append_config_option().
2018-02-13 17:40:14 +01:00
Axel Burri db1fe2d11a btrbk: fix output of "btrbk list backups" and "btrbk stats" (match all uuid/received_uuid combinations) 2018-02-07 16:24:49 +01:00
Axel Burri a835241ccf documentation: btrbk.1.asciidoc: add note about listing all snapshots for "btrbk list snapshots" 2018-02-03 13:18:19 +01:00
Axel Burri a3641cff74 btrbk: fix filter statement matching for volume="/"
While $vol->{URL} can contain "//" if volume="/" (intentionally, this
is an assembled path), the filter statements are sanitized using
check_url(). This means we need to match the filter statement against
check_url($vol->{URL}). Same applies to subvol.
2018-02-03 12:55:21 +01:00
Axel Burri 90fed6525e btrbk: bugfix: restrict snapshot_dir and snapshot_create to root/volume/subvolume context 2018-01-31 19:01:00 +01:00
Axel Burri 753d68b2ed btrbk: add documentation on caching in btr_tree() 2018-01-30 14:02:36 +01:00
Axel Burri 84bac59ab4 btrbk: fix parsing of "openssl_iv_size" configuration option 2018-01-21 18:53:29 +01:00
Axel Burri 308444f3ed documentation: FAQ.md: add warning on "dd" usage for disk cloning 2018-01-20 18:05:33 +01:00
Axel Burri b8e88f71a6 contrib: systemd: btrbk.service: add Documentation link to btrbk(1) 2017-10-24 13:29:06 +02:00
Axel Burri 57bc86b7a9 README.md: mention github source code repository 2017-10-13 14:02:50 +02:00
Axel Burri fa5309ee81 README.md: change git clone URL from git:// to https://
For security reasons, using the git:// protocol is discouraged.
2017-10-13 13:51:10 +02:00
Axel Burri 13f37491ed btrbk: cosmetics: change order of commands in help message 2017-10-12 17:08:46 +02:00
Axel Burri 659b7de82f doc/btrbk.conf.5.asciidoc: fix spelling 2017-10-12 17:07:05 +02:00
Axel Burri 79cbf7c0c3 change version to 0.26.0 2017-10-12 00:39:06 +02:00
Axel Burri c445b32459 doc/Makefile: use a2x --no-noxmllint for man page conversion 2017-10-12 00:39:06 +02:00
Axel Burri 780ef57895 documentation: remove experimental status of option "stream_buffer" 2017-10-11 20:54:41 +02:00
Axel Burri 909c68f164 btrbk: transaction_log and transaction_syslog are only allowed in root context 2017-10-11 20:54:41 +02:00
Axel Burri d941ecfce9 documentation: change digint links to https:// 2017-10-11 20:54:41 +02:00
Axel Burri 15dde32126 documentation: fix broken links 2017-10-11 20:54:41 +02:00
Axel Burri fdba94f8c7 documentation: btrbk.1.asciidoc: add action command / result matrix 2017-10-11 20:54:41 +02:00
Axel Burri c44c83bc33 Makefile: call doc/Makefile for installing files from "doc/" folder; use more variables 2017-10-11 20:54:41 +02:00
Axel Burri c26b7d3748 doc/Makefile: generate man pages from asciidoc 2017-10-11 20:54:41 +02:00
Axel Burri 2042c6ccd9 documentation: ssh_filter_btrbk.1.asciidoc: use "ssh_filter_btrbk" (without ".sh") in name section, as this is used as the output filename for asciidoc 2017-10-11 20:54:41 +02:00
Axel Burri c70e9bb757 documentation: ssh_filter_btrbk.1.asciidoc: cleanup 2017-10-11 20:54:41 +02:00
Axel Burri 0231051162 documentation: btrbk.1.asciidoc: cleanup 2017-10-11 20:54:26 +02:00
Axel Burri 3df8984337 documentation: btrbk.conf.5.asciidoc: change options subsections; cosmetics 2017-10-11 18:54:41 +02:00
Axel Burri 43399be0db documentation: btrbk.conf.5.asciidoc: add short descriptions for target raw options 2017-10-11 18:05:51 +02:00
Axel Burri c4ced9d6e4 documentation: convert all groff files (man pages) to asciidoc
- btrbk.conf.5 to btrbk.conf.5.asciidoc
 - btrbk.1 to btrbk.1.asciidoc
 - ssh_filter_btrbk.1 to ssh_filter_btrbk.1.asciidoc
2017-10-11 18:04:25 +02:00
Axel Burri e3ee674085 btrbk: limit search depth to 256 when resolving ancestors
Note that the current implementation is not very optimized, we should
introduce a parent/child hash table for all queries in
get_latest_common().
2017-10-10 16:46:05 +02:00
Axel Burri 3be65b9f67 btrbk: resolve ancestors (recursive on parent_uuid chain) when searching for latest common subvolume 2017-10-10 13:10:33 +02:00
Axel Burri 0799820556 btrbk: support btrfs-progs 4.13.2: adapt parsing of "btrfs subvolume list"
btrfs-progs v4.13.2 changed the output of "btrfs subvolume list", in
order to make the tabular output format look nicer (?!?):

e4c6772f69
2017-10-09 23:04:07 +02:00
Axel Burri e9a517f161 btrbk: add options "{snapshot,target,archive}_qgroup_destroy": destroy qgroups whenever a subvolume is deleted
Btrfs does not destroy qgroups when subvolumes are deleted (see
https://bugzilla.kernel.org/show_bug.cgi?id=91751). As a workaround
for this, btrbk can be configured to always destroy the corresponding
default qgroup "0/<subvol-id>" whenever a subvolume (snapshot, backup
or archive) is deleted.

Added configuration options:
 - snapshot_qgroup_destroy
 - target_qgroup_destroy
 - archive_qgroup_destroy
2017-10-02 16:23:23 +02:00
Axel Burri 6cb98700d8 btrbk: allow archive_preserve_* options in root context only 2017-10-02 13:54:37 +02:00
Axel Burri a5aaffa5b5 documentation: add "prune" to list of affected commands by several options 2017-10-02 13:44:35 +02:00