Adds the possibility to compare two snapshots interactively.
From the interactive snapshots view, press `D` to get to the diff view.
If two snapshots are marked, this diffs the two marked snapshots. If one
snapshot is marked or selected, this diffs with its parent (if there is
one).
Alternatively, you can use `rustic diff -i` to select snapshots/paths
directly.
The PR also allows to recursively compute added/removed space for dirs
and subdirs using `s` (like in #1479)
This PR is breaking as it also changes the output format of the normal
`diff` command.
If no grouping is given, the json output now displays all snapshots
without artificial grouping.
Also, in this case, the group is not displayed in non-json output.
closes#1362
This PR extends the logging. For `backup`, `forget`, `prune` the stdout
output is now printed via an INFO log which allows to see this
information also in the log file.
Moreover, when using a log file, rustic now also logs the version and
the used command.
closes#1454closes#1080
Note: This does not **use** the latest rustic core, but makes the
necessary modifications to make it work with `rustic_core` after the
latest dependency updates.
In a complex program the cause of SIGPIPE is unclear, it may come from
socket writes, or even socket reads under some conditions, as well as on
writes to pipes. As rustic depends on third party libraries to perform
IO and handle sockets, it has little power to control the socket and
operation flags for all IO to ensure that SIGPIPE has a clear meaning.
Per a comment on #1326 the original intent was to catch a SIGPIPE from a
use case such as `command | rustic backup -` however this situation will
not create a SIGPIPE anyway, and if it did it would likely result in
incomplete data due to command exiting immediately after writing into
the pipe buffer, rather than after all pipe buffer data has been read.
The behavior of pipes in this case is to EOF after all writers have
completed and all data has been read.
The situation the other way around is different, such as `rustic backup
| command`, this would generate SIGPIPE when rustic writes to the pipe
after command has exited. This signal is however superfluous, and still
not terribly useful, as it is often more useful to handle the EPIPE that
will be returned from the write call, and gracefully cease operations,
in whatever form is required.
closes#1326
Adds output as targz and zip.
Also adds the options `--archive` to choose the ouput format and
`--file` to directly specify a file to dump into. When a file is
specified, the ouput format is automatically chosen from the file
extension, if given.
---------
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
If you have a long-running process, like `webdav` or `backup` or others,
pressing CTRL+C usually results in a non-zero exit code:
`process didn't exit successfully:
P:\CARGO\.cargo-target-win\debug\rustic.exe -P <PROFILE> webdav (exit
code: 0xc000013a, STATUS_CONTROL_C_EXIT)`
This shouldn't be the case, as it was user initiated and we can shut
down gracefully.
This PR adds this functionality, so CTRL+C shuts down `rustic`
gracefully and exits with a 0 exit-code.
---------
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
Co-authored-by: aawsome <37850842+aawsome@users.noreply.github.com>
Adds filtering using `jq` syntax. You can do something like `--filter-jq
'.summary.files_new > 51'` - works similar to what you'd expect from
`jq`.
Also puts the `rhai` and `jq` filtering into features which are enabled
by default.
---------
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
Solves the webdav problem reported in #1181
---------
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
Use `getters` to early exit webdav when using `async_incompatible`
backends.
Using the type system or fixing all async compatibility issue is big and
structural work.
To avoid runtime crash for our users I suggest using this getter as a
temporary fix.
tracking issue: https://github.com/rustic-rs/rustic/issues/1181 (see for
more details)
> As far as I could tell, `webdav` feature was the only one spawning a
`runtime` in `rustic` and using it.
### Before merging this one:
- [x] rustic_core (core and backend) must be updated to a release that
includes rustic-rs/rustic_core#355.
---------
Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
This PR adds the `mount` command to rustic to access snapshot contents
as a read-only filesystem when the feature-flag `mount` is chosen.
As for the `webdav` command, there are following options:
- Access to a concrete snapshot/path, e.g. `rustic mount /mnt
37a63e5b:/my/path`.
- Access to all snapshots (maybe restricted by filters) by using
templates to define a virtual directory structure where snapshots are
located. Example: `rustic mount /mnt --path-template
"[{hostname}]/[{label}]/{time}" --time-template "%Y-%m-%d_%H-%M-%S"`
(these are also defined as default). Note that for all dirs containing
only snapshots, also a `latest` entry is generated. `latest` and
identical subsequent snapshots are symlinks when using `mount`.
This PR uses fuse_mt which is not optimal as it introduces some overhead
(e.g. needs to save whole Paths in-memory).
Note: Requires https://github.com/rustic-rs/rustic_core/pull/331 to
properly show all data of files (without it builds and runs, but files
are truncated and return error when reading).
Note: Building with the `mount` feature flag requires special
dependencies and is only possible on supported platforms, see
https://github.com/cberner/fusercloses#971
---------
Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
The `dump` command will now produce a tar when called with a directory.
---------
Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
chore(deps): update dependencies: tokio, ratatui, and tui-textarea
fix(clippy): use of deprecated method `ratatui::widgets::Table::<'a>::highlight_style`: use `Table::row_highlight_style` instead
This PR adds `run-before`, `run-after`, `run-failure` and `run-finally`
hooks for:
- all commands in the `[global.hooks]` config profile section
- commands accessing the repository in the `[repository.hooks]` config
profile section
- the `backup` command specifically in the `[backup.hooks]` config
profile section
- specific backup sources in the `[backup.snapshots.hooks]` section
Note: This PR includes only calling the given commands. If there is the
wish for supplying information to the commands (env variables or
parameter substitution), this should be covered by a separate feature
request/PR.
closes#902
---------
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
Adds the following filter options:
- `filter-paths-exactly` - filters exactly the given pathlists
(supersets don't match)
- `filter-tags-exactly` - filters exactly the given taglists (supersets
don't match)
- `filter-before` - filters by time (date or date+time can be given)
- `filter-after` - filters by time (date or date+time can be given)
- `filter-size` - filters by size of snapshot'ed data (upper and lower
limit may be given)
- `filter-size-add` - filters by size added to the repository (upper and
lower limit may be given)
---------
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
Fixed the capitalization of `dump` for the dump command, and then
figured, that there might be some better descriptions for other commands
as well.
---------
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>