Commit Graph

35 Commits (v0.32.2)

Author SHA1 Message Date
Asbjørn Apeland b618c2dd90 contrib: bash: completion.bash: complete options without =
Currently, option arguments are only completed after =. For example:

	$ btrbk --loglevel=<TAB>
	debug  error  info   trace  warn
	$ btrbk --loglevel <TAB>
	archive   diff      extents   ls        prune     run
	stats     clean     dryrun    list      origin    resume
	snapshot  usage

This commit makes it so that both option styles are recognized:

	$ btrbk --loglevel=<TAB>
	debug  error  info   trace  warn
	$ btrbk --loglevel <TAB>
	debug  error  info   trace  warn

This was the intention all along, but it was implemented incorrectly.
2022-05-29 18:03:36 +02:00
Axel Burri 4234fb2965 btrbk-verify: cleanup 2021-09-04 17:15:56 +02:00
Axel Burri d554afab10 btrbk-verify: allow ssh-user without ssh-identity
Required e.g. if a ssh-agent is already running, and we want to set
user=root for rsync.
2021-09-04 16:57:05 +02:00
Axel Burri af5d25c5a9 btrbk-verify: expect single quotes from btrbk raw table output 2021-08-18 02:08:28 +02:00
Axel Burri 808633a3ae btrbk-verify: remove workarounds for old versions; tidy eval 2021-08-09 19:06:20 +02:00
Axel Burri d9958cbbc1 btrbk-verify: use new raw table format keys 2021-08-09 19:06:20 +02:00
fr3aker 82860f0f4c btrbk_restore_raw.py: add script for restoring raw backups 2021-08-06 23:33:17 +02:00
Axel Burri 25c5e7b538 btrbk-mail: optionally prefix command output lines
Add configurable prefix for each line of command output. Seems wrong,
but outsmarts the mail clients.

The problem is that some (most?) mail clients outsmart the specs and
replace text/plain mails by quotations, emoticons, emphasis, ...
The only "correct" solution is to disable these features in the mail
client.

Acceptable workaround for #376.
2021-03-07 17:18:39 +01:00
Axel Burri 7340bdb5d6 contrib: bash: completion.bash: add action "list all" 2020-12-20 18:13:57 +01:00
Axel Burri 497b4e132e contrib: bash: completion.bash: add action "extents" 2020-12-20 18:13:30 +01:00
Axel Burri 03f7a8113d btrbk-mail: cosmetics: fix documentation 2020-12-02 20:39:33 +01:00
Asbjørn Apeland ce660a4989 contrib: bash: completion.bash: complete options everywhere 2020-11-01 13:44:46 +01:00
Asbjørn Apeland e4f27632a0 contrib: bash: completion.bash: add completion for lsbtr 2020-10-31 15:41:26 +01:00
Asbjørn Apeland 32c04e0b07 contrib: bash: completion.bash: complete commands 2020-10-31 15:27:50 +01:00
Asbjørn Apeland ae67a670f0 contrib: bash: completion.bash: complete option values 2020-10-31 15:27:50 +01:00
Asbjørn Apeland ac323e8b4b contrib: bash: completion.bash: add Bash completion for options 2020-10-31 15:27:50 +01:00
Axel Burri c2308a52a6 btrbk-mail: add more elaborated email and rsync options
- If rsync is enabled, show number of created/deleted/transferred
  files in mail subject.
- Add options to show summary and/or detail message in mail body.
- Add option to skip btrbk if no files were transferred via rsync.
- Add option to call sync(1) prior to running btrbk.
- Add option to skip btrbk execution if no files were transferred.
2020-08-29 12:31:18 +02:00
Asbjørn Apeland 2d7f5ec5fe contrib: systemd: btrbk.timer: change install target
Using `WantedBy=multi-user.target` makes boot wait for btrbk.service
before it's considered "finished". This can be checked by running
`systemd-analyze` or checking the system log using `journalctl`.

Timers should use the "timers.target" target, see systemd.special(7).
2019-10-27 12:24:00 +01:00
Axel Burri 805d7f4a0d btrbk-verify: add workaround for btrbk <= 0.27.2 bug: missing target_rsh, target_type
btrbk <= 0.27.2 does not print "target_rsh" and "target_type" when
called with --format=raw, see $table_formats{resolved}. This is fixed
in 0.28.0.

Hardcoding target_type=send-receive is not so bad, as for raw targets
btrbk-verify complains first with:

  btrbk-verify: missing required variable "target_rsh" in btrbk --format=raw line

So we should not run rsync (which is not really a problem, rsync just
fails with "not a directory").
2019-04-01 16:27:49 +02:00
Axel Burri 9ed41c8937 btrbk-verify: tool for automated backup integrity check based on rsync
Compare files and attributes by checksum, using rsync(1) in dry-run
mode with all preserve options enabled.

Resolves snapshot/backup pairs by evaluating the output of
"btrbk list latest [filter...]".

Restrictions:
 - ".d..t...... ./" lines are ignored by default:
   Root folder timestamp always differ.
 - "cd+++++++++ .*" lines are ignored by default:
   Nested subvolumes appear as new empty directories.
 - btrbk raw targets are skipped
 - rsync needs root in most cases (see --ssh-* options)
2019-04-01 16:27:45 +02:00
Axel Burri b8e88f71a6 contrib: systemd: btrbk.service: add Documentation link to btrbk(1) 2017-10-24 13:29:06 +02:00
Axel Burri 79cbf7c0c3 change version to 0.26.0 2017-10-12 00:39:06 +02:00
Axel Burri d941ecfce9 documentation: change digint links to https:// 2017-10-11 20:54:41 +02:00
Axel Burri 422d52c063 btrbk: add key derivation for encrypted raw targets using external backend 2017-09-28 14:17:00 +02:00
Axel Burri dcb0c5aa28 contrib/migration/raw_suffix2sidecar: add migration tool for creating raw sidecar files from uuid-suffixed raw backup files 2017-09-28 14:17:00 +02:00
Axel Burri 708444b096 btrbk-mail, README.md: suggest using "rsync --inplace"
When used without --inplace, rsync creates a new copy of the file and
moves it into place when it is complete, having the effect that btrfs
creates a new extent for the WHOLE file. With --inplace however, rsync
writes the updated data directly to the destination file, having the
effect that btrfs creates a new extent only for the differing part of
the file.
2016-08-17 14:49:27 +02:00
Asbjørn Apeland 16d73b4e5a Makefile: support .in files (use to replace @BINDIR@ in btrbk.service) 2016-07-13 20:56:28 +02:00
Axel Burri e4a7ba4be5 btrbk: add lockfile support, using perl "flock": add configuration option "lockfile <file>", and command line option "--lockfile"' 2016-06-07 16:17:02 +02:00
Axel Burri eabdba482e btrbk-mail: Use relative instead of absolute calls to system binaries
Make sure to have apropriate PATH set when calling btrbk-mail.
Usually specified in /etc/crontab, and should be correct by default on
all distros.
2016-05-09 12:13:22 +02:00
Moritz Ulrich d47cc25f60 btrbk-mail: bugfix: use `btrbk` instead of unbound variable `$btrbk` 2016-03-21 18:52:53 +01:00
Axel Burri 5c8d3f94f3 contrib: cron: btrbk-mail: append rsync stats to mail body 2015-10-25 12:20:59 +01:00
Axel Burri cb1b4d146d contrib: cron: btrbk-mail: add rsync and mount/umount functionality 2015-10-25 12:20:59 +01:00
Axel Burri 4925f3ac7d contrib: cron: btrbk-mail: wrapper script sending email with btrbk results and exit codes 2015-10-25 12:20:59 +01:00
Axel Burri 898f7ef0f6 contrib: systemd: fixed path in btrbk service unit 2015-05-21 15:52:50 +02:00
Axel Burri 09e214acf4 contrib: systemd: added systemd service and timer units (for daily backup) 2015-05-20 16:42:12 +02:00