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

Add support for relative paths backup method #601

Open
jibwf opened this issue Dec 5, 2024 · 3 comments
Open

Add support for relative paths backup method #601

jibwf opened this issue Dec 5, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@jibwf
Copy link

jibwf commented Dec 5, 2024

Note: if you have a question or want discussion please post in the discussions area.

Is your feature request related to a problem? Please describe.

Parent folders change impact snapshot

Note that when using absolute paths to specify the backup source, then also changes to the parent folders result in a changed snapshot. For example, a backup of /home/user/work will create a new snapshot if the metadata of either /, /home or /home/user change. To avoid this problem run restic from the corresponding folder and use relative paths.

https://restic.readthedocs.io/en/latest/040_backup.html#comparing-snapshots

Describe the solution you'd like
Run backup cli into the exact folder.

cd /home/user/work && restic -r /srv/restic-repo backup . --skip-if-unchanged

@jibwf jibwf added the enhancement New feature or request label Dec 5, 2024
@garethgeorge
Copy link
Owner

My initial thought is that this probably isn't something that makes sense for a built in capability for backrest, but is something that can be customized today by setting the working directory that you run backrest from.

Backrest doesn't do anything to change restic's working dir when forking it so it will be inherited.

@jibwf
Copy link
Author

jibwf commented Dec 5, 2024

@garethgeorge I am using backrest on my NAS. Now all backup dirs maps to /backup. Do you means separate them to different folders? But in this way, if I have 10 folders, I need map them in docker volume one by one.

@garethgeorge
Copy link
Owner

garethgeorge commented Dec 5, 2024

Not sure I follow -- at a high level that sounds potentially fragile. I think I'm more so pointing out that I don't see a general purpose solution where backrest changes the working directory.

E.g. cd some_dir && restic -r /srv/restic-repo backup . --skip-if-unchanged works well if you want to backup a single directory and it's the current working directory, but backrest supports lists of paths e.g. potentially many disjoint folders.

In terms of work arounds, you can change the workdir that backrest runs from and try to use relative paths -- but I don't have any strong recommendations for how you should setup your folders in that case beyond doing something that makes the most sense to you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants