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>
Due to changes in the way how merging of values were applied to
configuration values in `BackendOptions` this should is considered a
fix. Now values from the configuration file don't overwrite values from
environment variables, any more. As it was intended and stated in the
documentation.
Please make sure, your workflow is still working as intended, especially
that the configuration values and environment variables are applied as
you wanted it and as we documented it in the Configuration
documentation.
Precedence also applies when inheriting options from other profiles
using `use-profiles` or when using multiple profiles, e.g. `rustic -P
one -P two`. If the same repository option is defined in `one` and `two`
the value of `one` is taken. Before the fix, the value of `two` was
taken. But the fix only applies to the repository options. For other
options, `one` always had precedence.
Fixes#1226
---------
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
Co-authored-by: Alexander Weiss <alex@weissfam.de>
Breaking change: Targets for the `copy` command must now be given by
using config profile(s).
---------
Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
The `inner_run` implementation used `self`
to read its config when it should use `RUSTIC_APP.config()`.
Some might say this is counterintuitive.
fixes#1163
also now correctly respects having `prune = true` in the config profile.
---------
Co-authored-by: Alexander Weiss <alex@weissfam.de>
Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
Adds the possibility to view text files up to 1MiB in the interactive
snapshot tree view. Note this is a quick-and-dirty implementation which
could be improved better non-text-files and which could be optimized to
read files of all sizes
Adds the possibility to edit the filter used in the interactive
snapshots view:
- use 'V' to view or change the filter
- use 'Ctrl-v' to reset to the filter as given to the command
---------
Co-authored-by: nardor <nard0r@protonmail.com>
rustic now returns an error code for failing command.
Note: Some command do not fail yet fail in every cases user would expect
is. Most notably the `check` ckommand producing `error` messages may
still return error code 0.
closes#927
## Feature
**Add auto completion hints**
This helps some shells to propose better completions.
For instance on `zsh`, no completion were proposed when doing `rustic
backup <...>[TAB]`
## Hints added
- `rustic backup <...>[TAB]`
- `rustic backup --as-path [TAB] <...>`
- `rustic backup --stdin-filename [TAB] <...>` This one is for comfort,
as the compl might not help (or might), but my opinion is that it's
better than nothing.
- `rustic diff <snapshot_id> <...>[TAB]`
- `rustic find --path <...>[TAB]`
- rustic --log-file <...>[TAB]`
closesrustic-rs/rustic#440
### Description
The proposed code contains:
- a DiffStatistics structure used to hold count of stats
- this structure offers a few helping functions that will look at a
given NodeType to increment the associated counter
- it has a Display implementation used to display the statistics in
STDOUT
- this structure is used in the `diff` function
### Exemple
```bash
rustic --log-level debug -r test-repo --password password diff 8e57051d:config ./config
[INFO] using no config file, none of these exist: /home/nardor/.config/rustic/rustic.toml, /etc/rustic/rustic.toml, ./rustic.toml
[INFO] repository local:test-repo: password is correct.
[INFO] using cache at /home/nardor/.cache/rustic/3797e1fe324e97ac068e303e672da3d34af09cd73888bcfd09538cd72692bf7d
[00:00:00] reading index... ████████████████████████████████████████ 2/2
[00:00:00] getting snapshot... ████████████████████████████████████████ 0
[INFO] getting snapshot...
[00:00:00] getting snapshot... ████████████████████████████████████████ 0
- "README.md"
M "bar"
+ "new_dir"
+ "new_dir/new_file"
- "services"
- "services/b2.toml"
- "services/rclone_ovh-hot-cold.toml"
- "services/s3_aws.toml"
- "services/s3_idrive.toml"
- "services/sftp.toml"
- "services/sftp_hetzner_sbox.toml"
- "services/webdav_owncloud_nextcloud.toml"
Files: 1 new, 8 removed, 1 changed
Dirs: 1 new, 1 removed
Others: 0 new, 0 removed
```
### Testing
I am not sure what tests I can add.
Please let me know if you think of any test about this.
Thanks in advance for any feedback.
---------
Co-authored-by: Alexander Weiss <alex@weissfam.de>
Co-authored-by: aawsome <37850842+aawsome@users.noreply.github.com>
Currently if you run `rustic snapshots -i` without a repository
configured `rustic` will leave the terminal in raw mode.
This is a simple fix to make sure the terminal is properly reset in all
situations.
close#1166
Co-authored-by: aawsome <37850842+aawsome@users.noreply.github.com>
Adds the new command `find`.
This commands allows to search for glob pattern using `--glob`/`--iglob`
or given paths using `--path` in a list of snapshots.
It displays all finds and is able accumulate snapshots with identical
search result. This allows to use this command as a history search:
`rustic find --path /my/path` shows (only) all changes of that path.
If a panic happens, the interactive screen is now reset so the terminal
can show the panic output.
Moreover, "to-delete" was renamed to "to-forget" and the key bindings
were changed to f / Ctrl-f.
-- BREAKING CHANG --
Using multiple paths for a sources in the config file caused many
problems as the syntax was unclear and problems existed in edge cases.
This PR changes the definition of sources in config profile files:
- a single path path can be specified as before, i.e. using `source =
"/my/path"`.
- multiple paths must now be given in an array:
```
source = ["/my/path1", "/my/path2"]
```
Note that
```
source = "/my/path1 /my/path2"
```
is now interpreted a a single path using the dir-tree "my","path1 "
(with space), "my", "path2".
closes#1122closes#1094