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
Show history of file #3073
Comments
This is potentially very useful, but I'm not convinced it warrants a the exact feature proposed here. If you mount your repository, you can already do script something very similar with ease: cd $restic_mountpoint/hosts/laptop
# [^l]* skips "latest"
for f in [^l]*/data/myfile; do
stat "$f"
sha256sum "$f"
done |
I know, that if you trust the mtime, it is also sufficient to use
which would produce in my example
(still need to find the snapshots where those "versions" are referenced in) And with some more scripting, of course you could get the wanted result using But this feature proposal is about adding this functionality to restic directly, as I can imagine that this is something users may ask themselves quite often and those users maybe already use something like Moreover, I don't think that using the files hashes is a good way to go. We would need to load all blobs for each snapshot to hash them. For small files the cache in mount would do, but for large files this can by very slow. I would simply use the Thanks @cfbao for your references. Didn't find the discussion in the forum. Maybe this is some sort of duplicate of #2072. |
I want to develop a small graphical utility similar to what Déja Dup/Nautilus provide where you can right-click a file and restore old versions or right-click in a directory to restore files. What I'd like to present to the user is exactly what's being asked here, i.e. a list of versions and the time at which they were snapshotted. Any pointers to how I should do this and what I need to consider? |
This would be nice for managing files. I'm not sure mtime can be trusted in all cases, and re-hashing a multi-terabyte remote repository is not an option. |
I was looking for file history functionality and ended up using
This outputs a list of all the historic modifications of the files matching
|
Output of
restic version
restic 0.11.0 (v0.11.0-42-g9e4e0077) compiled with go1.14.7 on linux/amd64
What should restic do differently? Which functionality do you think we should add?
Add a possibility to show some kind of "history" for one or more file(s). An option would be to add an option to
restic find
.E.g.
restic find --history --long /data/my_file.txt
might produce something like:Of course, if using
find
, we should also sort/group the snapshots by paths and date. Just realized that this actually is not the case.What are you trying to do? What problem would this solve?
If a file is backuped by a automated procedure, it will be usually be contained in many snapshots.
Now imagine you need this file and just realize it has been "damaged" (e.g. by a user trying to work on it), You may want to get the last "undamaged" version from your backup.
However, restic so far can only produce a list of snapshots where the file is contained and you have to manually go through all of those to find the version. This may even apply if the file was just changed a few times. So it might be handy to have restic dermine how many different "versions" of this file really exist in the backup and which snapshots can be used to access those.
Did restic help you today? Did it make you happy in any way?
Backing up shared directories (where many users can write files) with restic makes me feel much more relaxed. Having many users with write access increases the risk of errors by mistake a lot. I'm happy to have a very good backup utility with restic here which simply works!
The text was updated successfully, but these errors were encountered: