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
Axel Burri
13708abd00
btrbk: consequently fence all trace logs (for performance)
2020-08-29 13:29:17 +02:00
Axel Burri
5d81632b5d
btrbk: cosmetics on logging
2020-08-29 13:28:32 +02:00
Axel Burri
5c32ced7d6
btrbk: show paths from all mounts in fs_path; add _fs_info node resolver
...
Reference complete mountinfo in nodes, instead of { file, subvolid }.
2020-08-29 13:28:32 +02:00
Axel Burri
cc3f6c95b9
btrbk: return array in _fs_path
2020-08-29 13:28:32 +02:00
Axel Burri
fbfd1edc3d
btrbk: move mount info to front in fs_list table format
2020-08-29 13:28:32 +02:00
Axel Burri
739645444e
btrbk: dont show subvolume_rel_path in fs_list table format
2020-08-29 13:28:32 +02:00
Axel Burri
9415214bc0
btrbk: reword/fix verbose and loglevel options
2020-08-29 13:28:32 +02:00
Axel Burri
910274f814
btrbk: support lsbtr symlink (alias for "btrbk ls")
...
If called via "lsbtr" symlink (program name):
- Provide user-friendly table options
- Assume "./" as path if no path arguments are given
2020-08-29 13:07:57 +02:00
Axel Burri
ec037952cf
btrbk: add "compat" config option (busybox: add test -d command)
...
Add compat, compat_local, compat_remote configuration options.
Used for busybox: instead of running `readlink -e` (which is not
available on busybox), run `readlink -f` followed by `test -d`.
2020-08-28 21:19:21 +02:00
Axel Burri
52a823bb93
btrbk: rename context "root" to "global"
...
Use same naming as in documentation: btrbk.conf.5
2020-08-28 20:49:28 +02:00
Axel Burri
c81e390415
btrbk: cosmetics: capitalize debug logs
2020-08-28 20:48:17 +02:00
Axel Burri
a140cbd898
btrbk: case-insensitive match hostname/ipv6 in filter statement
2020-08-27 10:38:23 +02:00
Axel Burri
61419d420a
btrbk: add support for ipv6 addresses
2020-08-27 10:38:23 +02:00
Axel Burri
12d80ee30b
btrbk: fix check on host
2020-08-20 17:02:45 +02:00
Axel Burri
b80d7e84de
btrbk: cosmetics on logging
2020-08-20 17:02:45 +02:00
Axel Burri
952e41443a
btrbk: always log target before source
...
Consistent for send/receive and send-to-raw.
2020-08-20 17:01:25 +02:00
Axel Burri
c11ab1507d
btrbk: sanitize url on PRINT
...
For consistency with PATH and URL, $vol->{PRINT} was not sanitized
(trailing "//" if parent is "/"). This is now dropped, as this is more
confusing than useful.
2020-05-24 02:48:12 +02:00
Axel Burri
936f88a68f
btrbk: action ls: support url argument; fix duplicates / sorting
2020-05-24 02:48:00 +02:00
Axel Burri
30edf5b766
btrbk: action ls: fix match on child subvols of "/"
...
If PATH contains double slash (intentional behavior of vinfo_child),
the match on root_path fails. Fixed by removing "//" from path.
2020-03-07 01:11:52 +01:00
Axel Burri
cb7d49d075
btrbk: change version to 0.29.2-dev
2020-02-29 17:40:55 +01:00
Axel Burri
e920283434
change version to 0.29.1; update ChangeLog
2020-02-09 16:18:00 +01:00
Axel Burri
0d19b0243e
btrbk: action ls: change default output to format=short
2020-01-02 16:58:07 +01:00
Axel Burri
c5b3ebb808
btrbk: action ls: allow multiple path arguments; soft fail on errors
2020-01-02 16:58:07 +01:00
Axel Burri
631a4c30fe
btrbk: fix @stderr propagation from vinfo_init_root
...
As we print @stderr in warnings if vinfo_init_root() function fails,
we need to make sure that @stderr contains sane values.
Clearing @stderr is required when calling caching functions!
2019-12-15 20:03:37 +01:00
Axel Burri
67d24695f1
btrbk: logging prints "..." on consecutive lines
2019-12-15 20:03:37 +01:00
Axel Burri
1f7773dddc
btrbk: try readlink only once per url
...
Change semantics of %realpath_cache: if "" (empty string), do not try
to run readlink shell command again on same URL.
2019-12-15 19:12:14 +01:00
Axel Burri
8c11c2eb7d
btrbk: run_cmd: fix regression: dont print ssh errors
...
Explicitely printing ssh errors (or even warnings) is
inconsistent. stderr is printed outside the run_cmd framework if
needed.
reverts a80e05984a
btrbk: catch ssh errors
See ssh(1):
ssh exits with the exit status of the remote command or with 255
if an error occurred.
Note that this includes network errors as well as dns failures
2019-12-15 19:12:06 +01:00
Axel Burri
9e13dbd933
btrbk: init sroot as late as possible when expanding wildcards
2019-12-15 19:10:01 +01:00
Axel Burri
37b30caeb2
btrbk: bugfix: vinfo_match: skip match against invalid paths
...
Dont check url_regex if $vinfo->{URL} is not a valid path (e.g. when
checking against a "volume" or "subvolume" having wildcards):
"Use of uninitialized value in join or string" at line 3030
2019-12-14 17:06:15 +01:00
Axel Burri
c36890e1eb
btrbk: change version to 0.29.1-dev
2019-12-14 17:05:54 +01:00
Axel Burri
b64ffbacf5
change version to 0.29.0; update ChangeLog
2019-10-27 14:00:40 +01:00
Axel Burri
8551a9f52a
btrbk: consistently use "subvolume" (instead of "subvol") for table headings
2019-09-08 18:23:30 +02:00
Axel Burri
5e87e8248b
btrbk: add --pretty option: print lowercase column headings with separator line
2019-09-08 18:23:30 +02:00
Axel Burri
4629d5ae11
btrbk: change table output format: remove separator line, uppercase column headings
...
Print table output column headings single-line uppercase instead of
lowercase and underlined.
This is common ascii table format, is easy parseable and offers better
readability e.g. in pager.
2019-09-08 18:23:30 +02:00
Axel Burri
485bc3ab0c
btrbk: use global stderr (replace err); refeactor filter_stderr, add fatal_stderr
...
if fatal_stderr is set and returns true, the command exit code is set
to -1, resulting in run_cmd() returning undef.
2019-09-08 18:23:30 +02:00
Axel Burri
360c8918bb
btrbk: catch verbose errors from readlink
...
readlink -v enables "report error messages", printing useful errors
like:
readlink: /some/dir/: Permission denied
readlink: /some/dir/: No such file or directory
2019-09-08 18:23:30 +02:00
Axel Burri
6e4aeae323
btrbk: cosmetics: enhance trace log
2019-09-08 18:23:30 +02:00
Axel Burri
d0f0c18f64
btrbk: logging functions take array as argument
2019-09-08 18:23:29 +02:00
Axel Burri
fa3334cbb7
btrbk: btrfs_subvolume_list_readonly_flag: dont die on parse errors
2019-09-08 18:23:29 +02:00
Axel Burri
3798677893
btrbk: run_cmd: return array of stdout lines instead of scalar
2019-09-08 18:23:29 +02:00
Axel Burri
4e39ed0fca
btrbk: print ssh errors (remove -q option)
2019-09-08 18:23:29 +02:00
Axel Burri
9f347a1067
btrbk: use open3 in run_cmd: fetch stderr separately
2019-09-08 18:23:29 +02:00
Axel Burri
a80e05984a
btrbk: catch ssh errors
2019-09-08 18:23:29 +02:00
Axel Burri
df471c3692
btrbk: refactor filter_stderr; more flexible error handling in run_cmd; simplify btrfs_subvolume_delete parsing
2019-09-08 18:23:29 +02:00
Axel Burri
8434c6881c
btrbk: system_list_mountinfo: also fetch mount_options (not only super_options)
...
This should have no impact on current code: "subvol" and "subvolid"
are used, which are only in super_options.
2019-09-08 18:23:29 +02:00
Axel Burri
8570ee585d
btrbk: fix backup summary: dont display no_action if volume is skipped by --exclude or noauto
...
The backup summary does not print "<no_action>" if a subvolume is
skipped by --exclude or noauto. Alas, skipped volumes results in
no_action still being printed (see #291 ). Adding an additional
IS_ABORTED($sroot, "skip_") check fixes this issue.
2019-09-07 13:44:25 +02:00
Axel Burri
2c9f1389a0
btrbk: fix vinfo() prototype; remove dead code; fix scheduler text; fix action diff header text
2019-08-07 21:35:54 +02:00
Axel Burri
4845bc6691
btrbk: print_formatted: fix skip-row-if-empty for --print-schedule
...
Fix: dont modify "-" %table_formats hash key.
fixes 716d420a40
btrbk: print_formatted: add skip-row-if-empty functionality for table_formats
2019-08-06 17:29:45 +02:00
Axel Burri
3ea7746700
btrbk: cosmetics: separate get_btrbk_date function
2019-08-05 15:15:55 +02:00
Axel Burri
ac175c0093
btrbk: cosmetics: rename timestamp_postfix_match -> btrbk_timestamp_match
...
Take separator match "\." out of statement:
$timestamp_postfix_match == \.$btrbk_timestamp_match
Remove/Fix unneeded "timestamp" hash key (dead code).
2019-08-05 15:15:55 +02:00
Axel Burri
8b93ef7c82
btrbk: fix fallback_default_config
...
- add for action-archive
- exit if config is present but has parse errors
2019-08-05 15:15:55 +02:00
Axel Burri
3e40903720
btrbk: add btrbk archive --raw option
2019-08-05 15:15:30 +02:00
Axel Burri
dcc57abac4
btrbk: archive: also apply exclude patterns on source subvolumes
...
Allows patterns like "svol.2019*".
Needs @exclude_vf to be a global variable, which is ok as this only
holds command-line args (and global context for archive_exclude).
Note that adding the same in "create backups" (action run) and
macro_delete() is not a good idea, as this has weird implications on
the "forced: last" snapshot/backup pair.
2019-08-05 14:55:38 +02:00
Axel Burri
6e55e08db7
btrbk: add archive_exclude_older option: skip resume of old backups
2019-08-05 14:55:38 +02:00
Axel Burri
97240de0c9
btrbk: add -L, --long options (shortcut for --format=long)
2019-08-05 14:54:04 +02:00
Axel Burri
66d15d1d64
btrbk: action "ls": add mount_subvol column to long formats
2019-08-05 14:54:04 +02:00
Axel Burri
0435f32619
btrbk: add stream_buffer_remote, rate_limit_remote; run stream_buffer only on local host
...
Change sematics of stream_buffer: If set, run on local host only. If a
remote stream buffer is required, use stream_buffer_remote /
rate_limit_remote.
2019-08-04 23:08:11 +02:00
Axel Burri
73108d2309
btrbk: fix: "readonly" is required key for "btrfs subvolume show" output
...
The "Flags: readonly|-" line is present as of btrfs-progs v4.6.1, and
is required in "target metadata check" of btrfs_send_receive().
2019-08-04 13:52:45 +02:00
Axel Burri
74be074e6f
btrbk: remove warnings on superfluous "btrfs subvolume show" output
...
Silently accept compatible versions of btrfs-progs. Required keys are
being checked below, no need to warn here.
e.g. btrfs-progs >= v5.2.1 prints:
Quota group: 0/258
Limit referenced: -
Limit exclusive: 1.00GiB
Usage referenced: 16.00KiB
Usage exclusive: 16.00KiB
2019-08-04 13:29:39 +02:00
Axel Burri
7d656540d7
btrbk: fix btr_tree for subvolumes containing special (unsafe) characters
...
Note that any action (e.g. btrfs send -p) on a subvolume with unsafe
characters will still fail with:
ERROR: Unsafe command [...] (offending string: "/tmp/btrfs_pool/svol with spaces")
2019-07-31 13:44:30 +02:00
Axel Burri
7271732f9e
btrbk: add action "ls": list all btrfs subvolumes below path
...
Features:
- get mounted filesystems from /proc/self/mountinfo
- fetch subvolumes using "btrfs subvolume list" (fast, needs root)
- filter and print subvolumes below mount point
2019-07-28 19:03:19 +02:00
Axel Burri
d88221e8bc
btrbk: add fallback_default_config action option, use for action "diff"
...
Preparatory for action "ls"
2019-07-28 19:03:19 +02:00
Axel Burri
381a12241b
btrbk: add dir_args: relative path arguments for actions reqiring directories
...
Preparatory for action "ls".
2019-07-28 19:03:19 +02:00
Axel Burri
9dc717c701
btrbk: use mbuffer instead of pv; add stream_buffer_sink framework
...
Add run_cmd option stream_buffer_sink, which handles stream_buffer,
rate_limit as well as --progress.
For rate limiting, run "mbuffer" (on the target host) in combination
with stream_buffer and --progress, instead of running "pv" (on the
source host).
Reasons:
- mbuffer limits the read rate: For remote targets, we want a stream
buffer in front of the rsh command pipe, before decompression.
- For local targets, this can be combined with --process.
- Combined stream_buffer and rate_limit: less commands in pipe.
Further changes:
- always set mbuffer -v1 option (never show warnings)
- restrict raw_target_block_size to "kmgKMG": compatibility to
stream_compress and rate_limit options, simplicity.
- use mbuffer blocksize option where applicable
2019-07-28 17:25:34 +02:00
Axel Burri
c7a8d0bb11
btrbk: fix naming: compress_cmd -> compress_cmd_text
2019-07-28 17:25:34 +02:00
Axel Burri
cf2c314627
btrbk: change version to 0.29.0-dev
2019-07-28 17:25:34 +02:00
Axel Burri
23770f2e67
change version to 0.28.3; update ChangeLog
2019-07-28 15:43:14 +02:00
Axel Burri
8ffd7ac1e9
btrbk: fix mount point resolving
...
Searching for longest match in mountinfo is plain wrong, as it is
possible (while very uncommon) to have a later mount point shadowing a
longer mount.
2019-07-18 15:34:52 +02:00
Axel Burri
fb3d4d96ff
btrbk: action origin: print uuid of unknown subvolumes
2019-07-15 18:36:12 +02:00
Axel Burri
5afa270577
btrbk: action origin: correctly handle root subvolumes having uuid
2019-07-15 18:36:06 +02:00
Axel Burri
8de7f45e89
btrbk: remove dead code
...
setting info{ERROR} does not make sense if info hash is not pushed to
SUBVOL_RECEIVED.
as of: c06bca17
2019-07-15 18:31:07 +02:00
Axel Burri
e7787e8a44
btrbk: replace "unrecoverable" hack by FIX_MANUALLY framework
2019-07-15 18:28:31 +02:00
Lubos Kolouch
836efa472b
btrbk: return error code 10 if unrecoverable problem
...
https://github.com/digint/btrbk/issues/285
2019-07-15 18:03:02 +02:00