-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
dump requires absolute path from within the repo #4443
base: master
Are you sure you want to change the base?
Conversation
The paths within a snapshot may differ from the attached path list if relative paths were used for the backup and to a certain extent for Windows paths. For example I wonder whether it would make sense to improve the description around how |
You clarified the discrepancy between the two paths very well and I used it to improve the backup command. I recommend to improve not only the backup command, but dump and listing (
I am not sure what you mean with "workaround". If you refer to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the path is necessary information, making the lookup a necessary procedure.
While I agree with the first part, I only partially agree to the second part. This is also why I called restic ls [...] /
a workaround. If you only have the information from the snapshots
command, then you're right. However, based on the parameters passed to the backup
command, it is possible to exactly tell where in the snapshot the files will end up (although the handling of file name collisions is not obvious).
@@ -45,6 +45,17 @@ size of the files and directories in ``~/work`` on the local file system. It | |||
also tells us that only 1.200 GiB was added to the repository. This means that | |||
some of the data was duplicate and restic was able to efficiently reduce it. | |||
|
|||
We just attached the absolute path ``~/work`` to the backup, so the path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to move this to it's own subsection, for example Paths in a snapshot
and then show a backup using a relative and an absolute path each followed with the corresponding output of snapshots
and ls
as illustration.
The jump from ~/work
to /home/user/work
may also not be obvious to every user, especially those that are unfamiliar with unix shells.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create such a subsection, and you are welcome to copy my text, which I then remove from this PR.
Ideally we can work on this branch, Git allows this.
I agree that ~/
could confuse Windows users, but I just wanted to be consistent with the documentation.
Shall I replace the 13 cases of ~/' with
/home/user/`in 040_backup alone, or do you want to do that?
doc/040_backup.rst
Outdated
@@ -45,6 +45,17 @@ size of the files and directories in ``~/work`` on the local file system. It | |||
also tells us that only 1.200 GiB was added to the repository. This means that | |||
some of the data was duplicate and restic was able to efficiently reduce it. | |||
|
|||
We just attached the absolute path ``~/work`` to the backup, so the path | |||
within the repository is ``/home/user/work``, depending on your user name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paths only exist within snapshots, not the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another argument why snapshots should list the attached path and the "path within the snapshot". And maybe inner path is a shorter name
@@ -45,6 +45,17 @@ size of the files and directories in ``~/work`` on the local file system. It | |||
also tells us that only 1.200 GiB was added to the repository. This means that | |||
some of the data was duplicate and restic was able to efficiently reduce it. | |||
|
|||
We just attached the absolute path ``~/work`` to the backup, so the path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a plain We backed up the absolute path ..., so the snapshot contains the full path:
followed by the output of ls
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think documentation should contain a path like /home/user/work
as example for an absolute path.
doc/040_backup.rst
Outdated
If we attach a relative path ``work``, the path within the repository is ``/work``. | ||
|
||
For example ``restic backup work`` run from ``/home/user`` crates a snapshot | ||
with a attached path ``/home/user/work`` that contains the path ``/work`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about [...] creates a snapshot with the directory /home/user/work stored in the snapshot metadata
plus showing the output of snapshots
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the column in the snapshots command is named Directory that would be consistent.
Should "attached path" be used at all?
doc/050_restore.rst
Outdated
@@ -156,6 +156,31 @@ e.g.: | |||
|
|||
$ restic -r /srv/restic-repo dump --path /production.sql latest production.sql | mysql | |||
|
|||
This example assumes you attached an absolute path, which means it coincides with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path stored in the snapshot metadata (==attached path) is always absolute. I think you mean you ran a backup using an absolute path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is clearer - I will change that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
In the longer term, a potential solution to simplify this and many other reported issues is being discussed in PR #4026. Part of the proposed approach relevant here is that all snapshots will use relative paths, much like existing archiving tools such as tar and zip. |
I did not remember the parameter, the rules are not documented, and therefore I only had the snapshots command. Until snapshots shows both paths, it is not a workaround |
Thanks for pointing to PR #4026, I need more time to read it completely. In short: I support the idea of snapshots using relative paths! |
What does this PR change? What problem does it solve?
Dumping a file following the present documentation resulted in the error message given below.
Was the change previously discussed in an issue or on the forum?
I found other discussions where dumping failed, but not sure if they are related.
To be discussed:
dump
requires the "Directory" path?