Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to specify multi-path-source in config file #8

Open
nickchomey opened this issue Mar 7, 2023 · 4 comments
Open

Document how to specify multi-path-source in config file #8

nickchomey opened this issue Mar 7, 2023 · 4 comments
Labels
good first issue Good for newcomers

Comments

@nickchomey
Copy link

nickchomey commented Mar 7, 2023

If I specify two paths, Rustic seems to ignore the glob that is set in the config file. If I backup the paths separately, it works fine. If I use full paths (/home/nick/ rather than ~/) the problem persists

nick@DESKTOP-DIFRTR1:~/devilbox$ rustic -r rclone:onedrive:wsl2 backup ~/apps/cloudflare/ ~/apps/haystack-app/ --dry-run
using config /home/nick/.config/rustic/rustic.toml
[00:00:00] reading index...               ████████████████████████████████████████         16/16                                                                                                                                                   
[00:00:00] getting latest snapshot...     ████████████████████████████████████████         13/13                                                                                                                                                   
[00:00:15] backing up...                  ████████████████████████████████████████  93.88 MiB/93.88 MiB  5.98 MiB/s   (ETA 0s)                                                                                                                     Files:       8490 new, 0 changed, 0 unchanged
Dirs:        20463 new, 0 changed, 0 unchanged
Added to the repo: 14.1 MiB (raw: 36.9 MiB)
processed 8490 files, 93.9 MiB
snapshot 00000000 successfully saved.
nick@DESKTOP-DIFRTR1:~/devilbox$ rustic -r rclone:onedrive:wsl2 backup ~/apps/haystack-app/ --dry-run
using config /home/nick/.config/rustic/rustic.toml
[00:00:00] reading index...               ████████████████████████████████████████         16/16                                                                                                                                                   
[00:00:01] getting latest snapshot...     ████████████████████████████████████████         13/13                                                                                                                                                   
[00:00:00] backing up...                  ████████████████████████████████████████   6.34 MiB/6.34 MiB   16.85 MiB/s  (ETA 0s)                                                                                                                     Files:       199 new, 0 changed, 0 unchanged
Dirs:        7 new, 0 changed, 0 unchanged
Added to the repo: 3.9 MiB (raw: 6.4 MiB)
processed 199 files, 6.3 MiB
snapshot 00000000 successfully saved.
nick@DESKTOP-DIFRTR1:~/devilbox$ rustic -r rclone:onedrive:wsl2 backup ~/apps/cloudflare --dry-run
using config /home/nick/.config/rustic/rustic.toml
[00:00:00] reading index...               ████████████████████████████████████████         16/16                                                                                                                                                   
[00:00:02] getting latest snapshot...     ████████████████████████████████████████         13/13                                                                                                                                                   
[00:00:00] backing up...                  ████████████████████████████████████████  54.09 KiB/54.09 KiB  5.00 MiB/s   (ETA 0s)                                                                                                                     Files:       4 new, 0 changed, 0 unchanged
Dirs:        6 new, 0 changed, 0 unchanged
Added to the repo: 16.1 kiB (raw: 56.8 kiB)
processed 4 files, 54.1 kiB
snapshot 00000000 successfully saved.
@aawsome
Copy link
Member

aawsome commented Mar 7, 2023

Thanks for reporting! Actually this is designed behavior. The reason is: if you backup ~/apps/cloudflare/ ~/apps/haystack-app/ as a "multi-path-source" it is still only possible to specify common backup option for this source. That is, you can't specify separate glob-files for both paths or let rustic respect .gitignore files for the first path but ignore them for the second path.

To specify common options, you have to give all paths in the config file like this:
source = "/home/nick/apps/cloudflare /home/apps/haystack-app"

I think this behavior needs better documentation, so I'll leave this open as docu topic.

In future we may add a multibackup command which basically just runs multiple backup steps in a row (generating multiple snapshots). After rustic-rs/rustic#411 there could then be also a --merge options to this command to directly merge the generated snapshots into one.

@aawsome aawsome changed the title Issue with multiple path backup How to specify multi-path-source in config file? Mar 7, 2023
@nickchomey
Copy link
Author

nickchomey commented Mar 7, 2023

Thanks very much.

I'm not sure that I want to include multiple paths in the same source, as it seems to me that it would make globs difficult to write - they'd conflict with each other.

Given that rustic -r repo backup will backup all sources in the config while respecting their individual globs, or specifying a specific source will use its defined glob, I figured that I would be able to just specify a couple of the sources contained within the config file and it would behave the same. There's no way to do this selective/filtered config-driven backup? Is it something that you'd consider adding?

If not, I suppose the alternative is to create a separate config file that only contains the subset of sources that I'm interested in. But that's enormously redundant.

Would multibackup be able to use individual sources within a single config file?

@aawsome
Copy link
Member

aawsome commented Mar 7, 2023

Would multibackup be able to use individual sources within a single config file?

Yes, definitely. This, and multiple types of sources (local FS, stdin, maybe others to come in future).
But I think if rustic-rs/rustic#472 is coming, the command to run all sources defined in a config file would be then rustic multibackup instead of the now-used rustic backup.

@nickchomey
Copy link
Author

Great! I look forward to seeing rustic-rs/rustic#472 come to fruition!

@simonsan simonsan transferred this issue from rustic-rs/rustic Sep 7, 2023
@simonsan simonsan changed the title How to specify multi-path-source in config file? Document how to specify multi-path-source in config file Oct 2, 2023
@simonsan simonsan added the good first issue Good for newcomers label Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

3 participants