Axel Burri
a25486336b
btrbk: fix regression: filter paths for action "ls"
...
regression from: eb69bc883e
btrbk: refactor mountinfo
2022-02-26 18:11:09 +01:00
Axel Burri
ff0a887c32
btrbk: call filesystem usage from mount point
2022-02-22 20:28:23 +01:00
Axel Burri
e9fe2cb5f5
btrbk: display all source subvolumes in btrbk usage
2022-02-22 20:28:17 +01:00
Axel Burri
31ce14e4c2
btrbk: handle errors from btrfs filesystem usage
...
Fix `btrbk usage` unhandled error case if usage data cannot be
retrieved, e.g.:
ERROR: Failed to fetch btrfs filesystem usage for: example.com:/mnt/btr_pool
ERROR: ... sh: ssh -i 'XXX' btrbk@example.com 'btrfs-filesystem-usage '\''/mnt/btr_pool'\'''
ERROR: ... cannot access '/mnt/btr_pool': Permission denied
2022-02-22 20:28:01 +01:00
Axel Burri
177f8547e3
btrbk: add backend btrfs-progs-doas
2022-02-08 01:06:04 +01:00
Axel Burri
d3b7540b87
btrbk: tidy backend command map
2022-02-08 01:05:59 +01:00
Axel Burri
db7082b4bc
btrbk: add config_key_lru comfort function
2022-02-06 17:44:30 +01:00
Axel Burri
68d5fe3f55
btrbk: add match argument in config_key
2022-02-06 17:44:30 +01:00
Axel Burri
e6ed21343c
btrbk: remove dead code
2022-02-06 16:05:12 +01:00
Axel Burri
0172e4a240
btrbk: fix mountinfo tree root detection
...
Set node as tree root if mount_id == parent_id. For some reasons this
is never the case on my (mostly gentoo) systems.
Regression from: eb69bc88
btrbk: refactor mountinfo
2022-02-06 12:35:57 +01:00
Axel Burri
ed8142ed9d
btrbk: bump version to 0.32.1-dev
2022-02-06 12:35:53 +01:00
Axel Burri
8676191d45
change version to 0.32.0; update Changelog
2022-02-05 19:34:54 +01:00
Axel Burri
8cc74fecc1
btrbk: default timestamp_format=long
...
This is a relict of early days of btrbk, and I have already hesitated
for too long to change the default from legacy "short" to sane "long"
format.
Tests show that the scheduling behaves in a sane/expected way if this
change is applied unattended. I suppose everybody who has
preserve_hour_of_day set is already using timestamp_format=long.
2022-02-05 18:47:49 +01:00
Axel Burri
ca166d47b6
btrbk: add safe_commands config option
...
For the paranoid. For convenience, filename checking was removed in
[1], and quoting was (hopefully) implemented correctly in [2].
Allowing special characters as well as UTF8 leave behind a bad
feeling, as there are many special cases that needs to be taken care
of (e.g. newlines in file names, right-to-left encoding, etc.). In
order to mitigate attacks expoiting these error classes, leave an
option to power users which do only allow "sane" characters in their
filename hierarchy.
[1] 6a29b08f00
btrbk: remove filename restrictions
[2] acc7f9fc83
btrbk: quote unsafe characters in shell commands
2021-11-06 16:40:47 +01:00
Axel Burri
4f72ad123f
btrbk: tidy error message
2021-11-06 16:09:51 +01:00
Axel Burri
cb38b7efa4
btrbk: parse additional "btrfs subvolume show" lines from btrfs-progs-5.14.2
2021-10-24 10:39:16 +02:00
Axel Burri
c538702d8c
btrbk: abort on unexpected only if receive target is not present
2021-10-04 19:17:36 +02:00
Axel Burri
bef13275d3
btrbk: fix regression: print quoted rsh command in table output
...
regression from: 27388c7589
btrbk: treat all filenames as unsafe
2021-09-04 15:46:57 +02:00
Axel Burri
1bda5fd978
btrbk: tidy safe_cmd; die if quoting leading dash for command
...
This should never happen, as all our filenames are checked to be
absolute.
2021-09-04 15:46:09 +02:00
Axel Burri
d1247359f8
btrbk: always return abort key
2021-08-28 14:49:12 +02:00
Axel Burri
faec607d02
btrbk: drop deprecated -r,--resume-only argument
...
Deprecated as of btrbk v0.26.0 (more than 3 years ago).
2021-08-28 14:06:10 +02:00
Axel Burri
3f84345bed
btrbk: tidy logging
2021-08-28 14:06:10 +02:00
Axel Burri
5dc2375a75
btrbk: fix raw file deletion
2021-08-28 14:06:10 +02:00
Axel Burri
424127441d
btrbk: fix unsafe path for btrfs send to file
2021-08-28 14:06:10 +02:00
Axel Burri
fe53198661
btrbk: drop support for deprecated raw format
...
Raw backups created by btrbk < 0.26.0 are now ignored:
*.btrfs_<received_uuid>[@<parent_uuid>][.gz|bz2|xz][.gpg][.split][.part]
2021-08-28 14:06:02 +02:00
Axel Burri
85c2d14287
btrbk: change incremental_prefs defaults
...
New defaults gives the btrbk_direct_leaf snapshots higher preference
than the global ones resolved by parent-uuid (which are best-guess).
This way the parent has a higher chance of being a backup created by
btrbk, which results in "btrfs receive" to start work on a snapshot of
this (and preferably not on the "best-guess" ones).
2021-08-27 17:20:47 +02:00
Axel Burri
bde0c10a6c
btrbk: add incremental_prefs config option
2021-08-27 17:20:47 +02:00
Axel Burri
6ca00feeb6
btrbk: tidy parent selection
...
Preparatory for incremental_prefs feature, no functional changes.
2021-08-27 17:20:47 +02:00
Axel Burri
10a6f51730
btrbk: remove deprecation on incremental_clones
...
btrbk does not set config defaults to global scope for deprecated
keys.
2021-08-27 17:20:47 +02:00
Axel Burri
9f877a4670
btrbk: remove extra clone source, deprecate numeric incremental_clones
2021-08-27 17:20:47 +02:00
Axel Burri
1cb958ee30
btrbk: add "match" target for deprecated options
2021-08-27 17:20:39 +02:00
Axel Burri
ad6298bf37
btrbk: add global split_match (cosmetics)
2021-08-19 17:16:50 +02:00
Axel Burri
eb69bc883e
btrbk: refactor mountinfo
...
- Create tree from /proc/self/mountinfo, and use it to find mount
points.
- Populate realpath cache from mount points, possibly reducing calls
to `realpath`.
- Replace btrfs_mountpoint with vinfo_mountpoint(fs_type => 'btrfs)
- Tidy action "ls".
- Move code
2021-08-18 13:14:10 +02:00
Axel Burri
063c25ad24
btrbk: add sanity checks on mountinfo list
2021-08-18 13:14:10 +02:00
Axel Burri
6a29b08f00
btrbk: remove filename restrictions
2021-08-18 13:14:10 +02:00
Axel Burri
b8370de9de
documentation: terminate options using double dash "--"
2021-08-18 13:14:10 +02:00
Axel Burri
81a04e4287
btrbk: use single quotes for raw table format
2021-08-18 02:08:28 +02:00
Axel Burri
48bf4f05b9
btrbk: fix table output for utf8 characters (require Text::CharWidth)
...
Use Text::CharWidth::mbswidth() if installed, fallback to
length(Encode::decode_utf8()), fallback to length().
- Text::CharWidth handles wide chars (e.g. asian, taking up two
columns on the terminal) correctly.
- length(Encode::decode_utf8()) handles single-width chars only, and
should be installed on most systems (perl >= v5.7.3).
- langth() counts bytes, as we do not convert anything to UTF-8 in
btrbk (NOT using `perl -CIOEioA` or binmode(STDOUT, ":utf8"))
2021-08-18 02:08:28 +02:00
Axel Burri
94a415e420
btrbk: check/sanitize leading/trailing whitespace on files
2021-08-18 02:08:28 +02:00
Axel Burri
3e9b581a54
btrbk: add --unsafe-filenames option
2021-08-18 02:08:28 +02:00
Axel Burri
1a7bbff767
btrbk: tidy run_cmd calls
2021-08-18 02:08:28 +02:00
Axel Burri
27388c7589
btrbk: treat all filenames as unsafe
2021-08-18 02:08:28 +02:00
Axel Burri
2933e65cbe
btrbk: adapt usage of unsafe arguments for run_cmd
2021-08-18 02:08:28 +02:00
Axel Burri
acc7f9fc83
btrbk: quote unsafe characters in shell commands
...
As filenames can contain meta characters like '$', we can't just put
ssh commands in double quotes. E.g. the following would trigger
variable expansion on local shell:
ssh example.com "ls -l 'evil$x'"
Instead, we quote the ssh using single quotes (adding the need to
escape single quotes), while also quoting unsafe filenames using
single quotes. The above becomes:
ssh example.com 'ls -l '\''evil$x'\'''
Or more complex, for a file named "file with'single quotes'":
ssh example.com 'ls -l '\''file with'\''\'\'''\''single quotes'\''\'\'''\'''\'''
On the remote shell, this will expand to:
ls -l 'file with'\''single quotes'\'''
2021-08-18 02:08:28 +02:00
Axel Burri
d7f6d5fecf
btrbk: accept quoted values in config
2021-08-18 02:08:28 +02:00
Axel Burri
5d94de9142
btrbk: use File::Spec for relative file arguments
2021-08-18 02:08:28 +02:00
Axel Burri
eccb24ecd7
btrbk: fix action "usage"
...
Regression from:
b658fba08c
btrbk: print snapdir and targets for action "usage"
2021-08-18 02:08:28 +02:00
Axel Burri
3cf69f3537
btrbk: add missing table ralign
2021-08-18 02:08:28 +02:00
Axel Burri
2f88d5ab4c
btrbk: check for deleted subvol before panicking
2021-08-18 02:08:28 +02:00
Axel Burri
6e7c8c409b
btrbk: cosmetics: fix trace log
2021-08-18 02:08:28 +02:00
Axel Burri
9278211123
btrbk: fix resolved ambiguity in raw table formats
...
rename snapshot_path -> snapshot_subvolume
rename target_path -> target_subvolume
These point to subvolumes, not paths containing subvolumes.
2021-08-09 19:06:20 +02:00
Axel Burri
2347163780
btrbk: table formats: replace source_path with source_subvolume
2021-08-09 19:06:20 +02:00
Axel Burri
b658fba08c
btrbk: print snapdir and targets for action "usage"
2021-08-09 19:06:20 +02:00
Axel Burri
7603e03aad
btrbk: never match dummy volume section
2021-08-09 19:06:20 +02:00
Axel Burri
e1c5fd0029
btrbk: remove superfluous checks on volume
2021-08-09 19:06:20 +02:00
Axel Burri
47ea1f9481
btrbk: fix action "config print" for dummy volume section
2021-08-09 19:06:20 +02:00
Axel Burri
e257077241
btrbk: allow subvolume context without volume (add dummy section)
...
Unfortunately the framework relies on "url" for the volume. This
should not be printed anywhere, using "/dev/null" should be fine.
2021-08-09 19:06:20 +02:00
Axel Burri
e2de9de440
btrbk: expand subvolume globs independent of volume
2021-08-09 19:06:20 +02:00
Axel Burri
3b4f275126
btrbk: accept absolute path for subvolume
2021-08-09 19:06:20 +02:00
Axel Burri
d40d75ef76
btrbk: accept absolute path for snapshot_dir
2021-08-09 19:06:20 +02:00
Axel Burri
5b2644f12a
btrbk: fix check_file: accept both relative and absolute options
2021-08-09 19:06:20 +02:00
Axel Burri
d3d04f2252
btrbk: remove subvolume_path from schedule table
...
This is the only format where SUBVOL_PATH is displayed. As SUBVOL_PATH
is only available for vinfo_child, this can not be used in global
scope.
2021-08-09 19:06:20 +02:00
Axel Burri
c1610c754d
btrbk: cleanup: add config_subsection
2021-08-09 19:06:20 +02:00
Axel Burri
247cb37acf
btrbk: add comment on vinfo_child specific keys
2021-08-09 19:06:20 +02:00
Axel Burri
2d854c7327
btrbk: add comment on clone source from different mount point
2021-08-09 19:06:20 +02:00
Axel Burri
86e902cebc
btrbk: remove dead code
2021-08-09 19:06:20 +02:00
Axel Burri
ce9c21bd24
btrbk: tidy check for btrbk subvolume
...
The original idea was probably to have a trace log for skipped
subvols.
2021-08-09 19:06:20 +02:00
Axel Burri
f86c563715
btrbk: tidy superfluous subvol_dir argument
2021-08-09 19:06:20 +02:00
Axel Burri
2da30f6b96
btrbk: bump version to 0.32.0-dev
2021-08-09 19:06:20 +02:00
Axel Burri
feba54a68d
change version to 0.31.3; update ChangeLog
2021-08-07 00:13:21 +02:00
ullr23@gmail.com
322ae2c78f
btrbk: add support for zstd adaptive compression
...
Requires zstd version >= 1.3.6
2021-08-06 17:51:20 +02:00
Axel Burri
bf0b5997e8
btrbk: allow relative path arg for actions: archive, extents, diff, origin
2021-08-01 14:11:50 +02:00
Axel Burri
16cec0f6d4
btrbk: tidy map relative subvol argument
2021-07-25 13:32:27 +02:00
Axel Burri
2824668c0e
btrbk: fix path sanitizer
...
Sanitize "/././" -> "/"
2021-07-24 14:40:30 +02:00
Axel Burri
5524d16707
btrbk: add warn_unknown_targets config option
2021-07-15 14:11:03 +02:00
Axel Burri
54bb876b85
btrbk: tidy check_file
2021-07-15 14:11:03 +02:00
Axel Burri
47a3aa5849
btrbk: tidy assemble piped command; remove dead code
2021-07-15 14:11:03 +02:00
Axel Burri
af6d719acc
btrbk: fix: ignore mount points with unsupported filename in action "ls"
...
Mount points with illegal characters would die in vinfo. Print error
and ignore.
2021-07-15 14:11:03 +02:00
Axel Burri
12f6c5b69f
btrbk: tidy mountinfo comments
2021-07-15 14:11:03 +02:00
Axel Burri
6c13a64459
btrbk: fix mountinfo parsing (octal encoded chars)
...
Making sure this is done after splitting, as encoded value could be a
comma.
After some testing it shows that the kernel [1] produces ambigous
output in "super options" if a subvolume containing a comma is mounted
using "-o subvolid=" (tried hard to mount with "-o subvol=", seems not
possible via shell):
# btrfs sub create /tmp/btrbk_unittest/mnt_source/svol\,comma
# mount /dev/loop0 -o subvolid=282 '/tmp/btrbk_unittest/mount,comma'
# cat /proc/self/mountinfo
[...]
48 40 0:319 /svol,comma /tmp/btrbk_unittest/mount,comma rw,relatime - btrfs /dev/loop0 rw,ssd,noacl,space_cache,subvolid=282,subvol=/svol,comma
^^^^^^^^^^^^^^^^^^
[1] sys-kernel/gentoo-sources-5.10.45
2021-07-15 14:11:03 +02:00
Axel Burri
eac9ef9828
btrbk: print non-parseable btrfs mountpoint info only once
2021-07-15 14:11:03 +02:00
Axel Burri
db4f96ba65
btrbk: add function INFO_ONCE
2021-07-15 14:10:59 +02:00
Axel Burri
2c19c501a7
btrbk: add "-1,--single-column" command-line option
2021-07-15 13:50:11 +02:00
Axel Burri
e82836be47
btrbk: add single_column output format
2021-07-15 13:50:11 +02:00
Axel Burri
c06d94543c
btrbk: add "backups" output format
...
Preparatory for single-column patchset.
2021-07-15 13:50:11 +02:00
Axel Burri
d80a8abb8a
btrbk: add "latest" output format
...
Same as "resolved", but hides target if none present.
2021-07-15 13:50:11 +02:00
Axel Burri
d7902fb30c
btrbk: rename action_list table formats
2021-07-15 13:50:11 +02:00
Axel Burri
f197a08650
btrbk: tidy table_formats
2021-07-15 13:50:11 +02:00
Axel Burri
bd68b15ebc
btrbk: tidy print_formatted
2021-07-15 13:50:11 +02:00
Axel Burri
37ef87ddaf
btrbk: add url to fs_list raw format
2021-07-15 13:50:11 +02:00
Axel Burri
cd69d29705
btrbk: tidy variable name
...
Duplicate use (not a bug)
2021-07-15 13:50:04 +02:00
Axel Burri
043e270522
btrbk: change version to 0.31.3-dev
2021-05-27 23:26:38 +02:00
Axel Burri
e8622fc6be
change version to 0.31.2; update ChangeLog
2021-03-21 13:34:26 +01:00
Axel Burri
b8a6aaf799
btrbk: warn if no subvolume is configured
2021-03-18 20:03:03 +01:00
Axel Burri
a8341659be
btrbk: change version to 0.31.2-dev
2021-03-18 19:56:43 +01:00
Axel Burri
8402195487
change version to 0.31.1; update ChangeLog
2021-03-07 17:49:26 +01:00
Axel Burri
db8cc1cd14
btrbk: collapse empty column in total of action "stats"
2021-02-27 13:26:31 +01:00
Axel Burri
713fe50372
btrbk: add empty_cell_char argument to print_formatted
2021-02-27 13:26:03 +01:00
Axel Burri
cee6553a49
btrbk: fix duplicate snapshot location check
...
If snapshot_create=no, no snapshot is created and thus should be
excluded from "duplicate snapshot locations" check.
2021-02-14 15:05:03 +01:00
Axel Burri
8d25852ce2
btrbk: fix action "list all"
2021-02-14 14:23:17 +01:00
Axel Burri
9c2e4e1ee2
btrbk: change version to 0.31.1-dev
2021-01-16 20:40:49 +01:00
Axel Burri
7dc827bdc3
change version to 0.31.0; update ChangeLog
2021-01-10 16:54:53 +01:00
Axel Burri
28e5e08305
bump copyright year
2021-01-10 16:54:50 +01:00
Axel Burri
e0b8c0b34f
btrbk: consistently return array
...
While returning an arrayref might be slightly faster, consistently
return an array in all node lookup functions.
2020-12-30 17:57:39 +01:00
Axel Burri
42dd296ce7
btrbk: make related_nodes and correlated_nodes functions operate on nodes only
2020-12-30 17:57:23 +01:00
Lukas Straub
dd5991099a
btrbk: add suport for zstd long distance matching
2020-12-26 15:46:47 +01:00
Lukas Straub
3562e75a70
btrbk: add support for zstandard (zstd) compression
2020-12-26 15:46:20 +01:00
Axel Burri
6cce65e1eb
btrbk: remove big header in action "diff"
2020-12-21 00:30:06 +01:00
Axel Burri
c7dd838a81
btrbk: simplify action "diff"
2020-12-21 00:20:15 +01:00
Axel Burri
2c4827ca9f
btrbk: support custom table format
2020-12-20 20:12:20 +01:00
Axel Burri
792c3de6c0
btrbk: separate format for "ist snapshots"
...
Make sure target_subvolume is always printed for "resolved" format.
2020-12-20 18:32:47 +01:00
Axel Burri
28d4ec6a0b
btrbk: print latest snapshot after latest correlated
2020-12-20 18:20:43 +01:00
Axel Burri
4fa6dfde25
btrbk: add target_type to "list config" table
2020-12-20 13:45:30 +01:00
Axel Burri
4f8274b28e
btrbk: collapse all target columns for "resolved" format
2020-12-20 13:45:30 +01:00
Axel Burri
1bd902d955
btrbk: collapse host columns for most formats
2020-12-20 13:45:30 +01:00
Axel Burri
bba7c06486
btrbk: refactor action list and stats; add "list all"
2020-12-20 13:30:50 +01:00
Gavin Yancey
31475a303f
btrbk: look in the correct directory for btrbk list snapshots
2020-12-20 13:27:21 +01:00
Axel Burri
6669855936
btrbk: add source and target url to resolved raw format
2020-12-13 17:33:15 +01:00
Axel Burri
3ff42c60d1
btrbk: move snapshot_preserve column towards target_preserve
2020-12-13 17:29:48 +01:00
Axel Burri
4b7f4f6d81
btrbk: always collapse port and rsh columns
2020-12-13 17:29:05 +01:00
Axel Burri
16746caa16
btrbk: fix target_type column for "list backups" action
2020-12-13 15:07:29 +01:00
Axel Burri
557f2f5387
btrbk: add rsh column to list actions with format=long
2020-12-13 14:42:38 +01:00
Axel Burri
bda59056e8
btrbk: more accurate wording on type values for action list
...
Terminology for "backup" is specified in btrbk(1), use it:
Backup is a btrbk terminology for a "read-only subvolume created
with send/receive" (showing a received-uuid).
2020-12-13 14:05:34 +01:00
Axel Burri
33e3dee046
btrbk: fix action origin and ls
...
Regression:
a96c613ab8 btrbk: add subvol_args_init: map subvol_args cmdline arguments into vinfo
2020-12-12 21:43:23 +01:00
Axel Burri
53d5536929
btrbk: fix fs_path
...
Fixes action "origin" and logging.
Regression:
cc3f6c95b9
btrbk: return array in _fs_path
2020-12-12 21:43:23 +01:00
Axel Burri
db7e92b134
btrbk: extents-diff: add extents list command
2020-12-12 21:43:23 +01:00
Axel Burri
b01a97c36f
btrbk: extents-diff: more logging
2020-12-12 21:43:23 +01:00
Axel Burri
f9cc5af7b9
btrbk: extents-diff: add ID to long format
2020-12-12 21:43:23 +01:00
Axel Burri
63def23feb
btrbk: extents-diff: always display set-exclusive size
2020-12-12 21:43:23 +01:00
Axel Burri
e3987866d3
btrbk: extents-diff: fix logging, documentation
2020-12-12 21:43:23 +01:00
Axel Burri
22b71bf7da
btrbk: extents-diff: list all related (not only older)
2020-12-12 21:43:23 +01:00
Axel Burri
208fc36231
btrbk: extents-diff: add (hidden) option: ignore_extent_data_inline
2020-12-12 21:43:23 +01:00
Axel Burri
0719fc415d
btrbk: cleanup aio extentmap
2020-12-12 21:43:23 +01:00
Axel Burri
dc1b7f1b5c
extents map: add alternative implementation using IO::AIO (slightly faster)
2020-12-12 21:43:23 +01:00
Axel Burri
70cdcb01c6
btrbk: cosmetics: fix spelling
2020-12-12 21:43:23 +01:00
Axel Burri
74a84f715b
btrbk: extents-diff: remove blocksize from regions
...
`filefrag -b1` effectively calculates byte regions.
2020-12-12 21:43:23 +01:00
Axel Burri
afd6f80739
btrbk: extents-diff: calculate exclusive size; add "exclusive" option
2020-12-12 21:43:23 +01:00
Axel Burri
ea2ec1ceaa
btrbk: print_formatted: allow custom format
2020-12-12 21:43:23 +01:00
Axel Burri
7facb44833
btrbk: add extentmap_cache (new cache_dir option)
2020-12-12 21:43:23 +01:00
Axel Burri
c6375967b8
btrbk: add action "extents-diff"
2020-12-12 21:43:23 +01:00
Axel Burri
1a96216e7b
btrbk: add subvol_args_init: map subvol_args cmdline arguments into vinfo
...
Preparatory for extents-diff command
2020-12-12 21:43:23 +01:00
Axel Burri
a8e82a6b2c
btrbk: add extentmap framework (filefrag)
...
Preparatory for extents-diff command
2020-12-12 21:43:23 +01:00
Axel Burri
3cbcc74bc3
btrbk: run_cmd: add large_output option (suppress stdout dump of command)
2020-12-12 21:43:23 +01:00
Axel Burri
a99292aba8
btrbk: fix alignment if no header is printed
2020-10-30 19:09:50 +01:00
Axel Burri
528a152d6d
btrbk: action "diff": use print framework; convert units
2020-10-30 19:09:26 +01:00
Axel Burri
4866ec5cb0
btrbk: add print_size, and command line option modifier
2020-10-30 18:35:52 +01:00
Axel Burri
81c92940c1
btrbk: fix unitialized value in warning
...
Regression from: 5c32ced7d6
2020-10-19 00:34:11 +02:00
Axel Burri
eb852271b6
btrbk: change version to 0.30.1-dev
2020-10-19 00:33:20 +02:00
Axel Burri
f40e3adce3
change version to 0.30.0; update ChangeLog
2020-09-23 15:48:44 +02:00
Axel Burri
e605bc7b42
btrbk: add backend_local_user config option
2020-09-23 12:59:50 +02:00