-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Omit snapshot creation if there was no change #662
Comments
Maybe it would be a good idea to still create a kind of alias name. |
We'll need to define what "no change" means: "No files were added/removed and no files have different content" and/or "no metadata and no content has changed". |
As discussed on IRC: Not making a new snapshot may interfere with the |
I'm curious though: Why do you need this functionality? What's your use case? |
I just felt as it is unnecessary to clutter up the repo with snapshots that aren't of any use to me. All in all this is of cause a "nice to have" as there are plenty of ways to work around this (or better: to correctly use restic 😃). I just wanted to bring that up as I thought about it and so might be others. |
Thanks for the explanation. What I had in mind when building restic and the repository structure was that a "snapshot" captures the state of the data at one point in time. If the data hasn't changed at all compared to any previous snapshot, an additional snapshot is very cheap and only uses a few hundred bytes and one additional file in the repository. You are right that more snapshots may slow operations down a bit, especially for high-latency remote backends, but I'm convinced this effect is negligible. If it isn't we can certainly optimize it (compare #523), but then I'd like to measure/benchmark first to get hard data :) I'll close this issue for now, you can still add comments (and we can easily reopen it later). |
Hi, first time restic user here, trying it out. It looks great so far. Reading the IRC chat log it seems it wouldn't be much effort to add this. Could this be added as a flag to backup, so users could at least have a choice? |
Although I'd never use such an option myself I'd like to chime in on the question what 'no change' should mean. @fd0 stated
IMHO the only valid choice here would be the "AND" choice:
On the first glance I'd thought there was some redundancy to this, as usually any content change would also induce a change of mtime. But on second thought there are always tools to set an ctime/mtime explictely so neither checking only the contents alone, nor checking only the metadata alone is enough. I believe there are some issues that ask for stats collection during a backup (e.g. #693, #874). I'd guess that the stats collection code needed to them would be useful here, too. |
@ignus2 thank you for describing your expectations and your reaction, that's very valuable for us as a project! Restic snapshots can be compared more to "virtual machine snaphots" or "lvm/zfs file system snapshots" than e.g. a |
So would it be possible to add the flag to skip creating a snapshot if nothing changed? |
It would be possible to add this, but I don't think we'll add it: It's just not the way how restic works and will cause problems when you use the |
It wouldn't change the way restic works by default, as it would be an optional flag. What kind of problems would it cause with the forget command btw? |
Optional code paths need to be tested and maintained too! So, it creates ongoing technical debt for a feature that is a bit unusual.
I don't recall: did you explain why having "empty" snapshots is such a problem for your use case?
…--
Michael L. Barrow
michael at barrow dot me
+1.541-600-2027
On Oct 11, 2017, at 06:04, Balázs Oroszi ***@***.***> wrote:
It wouldn't change the way restic works, as it would be an optional flag. What kind of problems would it cause with the forget command btw?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
The idea behind the There's really no such thing as an "empty" snapshot in restic. Each snapshot captures the data and metadata at a given point in time and is independent (concerning the data structures) from all the other snapshots. Btw, if you really like to do that, you could use |
Yes I know they're not empty. I just used that term to more closely describe them per this particular scenario; "empty" implying little to no value to the OP based on the criteria of no files changing.
…--
Michael L. Barrow
michael at barrow dot me
+1.541-600-2027
On Oct 11, 2017, at 07:30, Alexander Neumann ***@***.***> wrote:
The idea behind the forget command (as explained e.g. in this blog entry) is that you specify a policy for snapshots that you'd like to retain. If you only have snapshots for when data has changed, specifying e.g. --keep-daily does not make sense any more.
There's really no such thing as an "empty" snapshot in restic. Each snapshot captures the data and metadata at a given point in time and is independent (concerning the data structures) from all the other snapshots.
Btw, if you really like to do that, you could use restic snapshots --json, then take the snapshot IDs, use restic cat snapshot <id> for each and drop the ones where the tree IDs haven't changed. That'd amount to roughly removing "empty" snapshots.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'm going to reopen this issue. |
What is "unusual" is a matter of opinion I believe, for me having "empty" (by the definition of "having little to no value based on the criteria of no files and their metadata changing") snapshots is unusual. Regarding the forget policy, I don't see how it would interfere. For example running restic backup occasionally (possibly depending on other means to determine whether something changed and a backup needs to be made or not) would have the same effect as skipping creating a snapshot, in which case forget also wouldn't make sense as you write. I'd like to emphasize again, that it would be an optional feature for those who would like to use restic in a slightly different manner, who perhaps would never use the keep-daily etc forget features at all. Thanks for mentioning a workaround btw. |
I'm curious: Does other backup software typically have such an option? |
I don't know, but if so, then restic should also, if not, restic could be unique in this regard ;) BTW, I seem to understand the resistance to this feature, as restic puts emphasis on the "when" or "time" of the backup (also indicated by the way forget works, centered around time), hence a snapshot in time. While the use case I have in mind (and maybe the OP too) is more emphasis on the "changes" with the additional side-information of "when". EDIT: Something like git, or is thinking about restic like the way git works (from the end user perspective) is a totally bad idea? |
IMHO, this kind of "cleverness" has no place in backup software. If I ask backup software to do the backup, I'd like it to not play games behind my back, have opinions of it's own, nothing's changed etc... So, later tomorrow I scratch my head looking for last nights backup, which isn't there?! Let's keep thing simple, if there's nothing new to backup, well.. then don't backup! Decide outside backup software, then dispatch backup or not. Too clever backup software would be unreliable backup sofware. I'd like it to be reliable, not too clever, if at all possible. |
I have never seen this, which is why I used "unusual" to describe this
feature in my previous message.
The other reason why it's unusual is that it's kind of against the concept
of a data protection solution. The snapshot represents the state of the
world at that time (refer back to the explanation about the fact that
snapshots aren't really empty).
If a snapshot wasn't removed, it would be hard to tell if the snapshots
actually happened and was deemed unneeded by this criteria, or if the
system failed.
*michael at barrow dot me*
+1.541.600.2027
"Do not anticipate trouble, or
worry about what may never happen.
Keep in the sunlight." -- B. Franklin
…On Wed, Oct 11, 2017 at 8:31 AM, Balázs Oroszi ***@***.***> wrote:
I'm curious: Does other backup software typically have such an option?
I don't know, but if so, then restic should also, if not, restic could be
unique in this regard ;)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#662 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABzVspDVasI91Mp4B2hFCMlsCWGr_B-Vks5srN9IgaJpZM4KrXNh>
.
|
@zcalusic This "cleverness" would be hidden behind an optional command line switch, so only those users would be affected by it who specifically ask for it. |
I am a new user to Restic and this "Omit snapshot creation if there was no change" was one of my first questions as I start to learn how restic works, so glad google found me this issue. What is the current situation? Is there an easy way I can code this feature in any script I write?
|
This discussion in the forum might have an answer for you: |
It's a shame that this basic functionality has no movement, especially considering that some The discussion forum solution involves installing additional third party software and learning a new DSL ( Years ago @fd0 asked for no work to be done on this feature due to some reworking of archiver code, and surely that work is either done by now or postponed ? It seems from @ignus2's commit that only an extremely minimal change would be required to support this (optional !) feature that plenty of people seem to be interested in, so I would ask for a renewed assessment whether we can't please have it. |
The usage problems with |
This feature would help reduce clutter in a system where many backups are required for various different reasons. Append-only backups are probably the biggest player here. To address some of the arguments against the proposed patch, and my rebuttals for them:
if flags.NoEmptySnapshots && len(changes) == 0 {
return status.OkButNothingChanged;
} which really doesn't add any cleverness.
I could just go ahead and use In the end, it's your decision, I'm not maintaining this project and sadly do not have time to delve into yet another one, but I and others would definitely appreciate if this was added. |
In this thread I read a proposal for restic gaining a new forgetting policy which keeps just the latest snapshots from series of unchanged snapshots. The feedback was that snapshots are cheap to store and provide additional helpful information: that a snapshot was made. Instead of forgetting, could restic instead provide a convenient way to query a list of all snapshots which included changes from their parents? Then, users could use e.g. the standard shell tool |
Are we singling out a particular operating system here? remember, restic is supported on multiple operating systems, unless this is something that can work across the board, I do not think it's the solution. |
Just to chime in here, I'm looking to migrate from https://www.arqbackup.com/ , and I have the same use case as previous commenters (files which don't change often, I only want to see backups when there is a change). Obviously this is open source and we're free to use work-arounds, but, I thought I'd add a 👍 for the use case. |
I am very interested to see such option. I don't know if it is mentioned, but would be nice to see when a change really happened, for some specific cases, just like a git commit. |
Due to the fact that so anticipated option not to create a snapshot 'if nothing has changed' never appeared in Restic despite 7 years of discussion, this dismal state of affairs has now migrated to a more advanced Rustic. Argh! Is there at least some magic command that could delete snapshots that are not different from the previous ones? |
Heh, am setting up another restic, wanted this functionality, came looking, found this thread. Amusing. My use case is that I want to basically 'time machine' a particular folder with a cron running every minute. Sometimes I screw up and accidentally delete files. I want insurance against that kind of footgun. Time Machine is not fast enough for my purposes, Arq is a resource hog, and I already use restic for stuff so.... I'll just be storing 20 identical snapshots for the last 20 minutes! It's free software so who am I to complain? |
@mpr1255, free software is paid for by other means. For example, a catchy line in the resume, a sense of belonging to the development of civilization, a sense of superiority over greedy capitalists and clumsy corporations, the attention of the opposite sex, etc. The lack of direct financial reward also does not override the courtesy: imagine that a neighbor announces himself as a musician playing for free at children's parties, you invite him to your house, he plays great, but at the same time he spits on the floor and stubbornly ignores requests to adapt. @fd0 has been ignoring us, this issue… |
@sergeevabc That is extremely out of line. You literally have no idea about what goes on in @fd0's life or how he spends his time. I do, and I can tell you with 100% certainty that he has not been ignoring you or anyone else. You may not be happy with the state of this issue, and that's entirely in your right to be, but let's keep communication civil and not write things which are totally uncalled for. Let future communication here be on topic and not personal reflection or attacks. Thanks. |
@rawtaz, it's called sugar-free feedback — an inevitable consequence of participation in public life. The feelings of the people who put their trust in your project matter, too. The list of feelings is not limited to gratitude. Talking about that is not beyond the bounds of decency. If you keep people without certainty for many months and even years, then the frustration begins to grow. This casts a shadow on the entire enterprise and undermines trust. If you are such a caring friend, then remind the author that he is not in a coma, like his compatriot, the famous racing driver Michael Schumacher, and is able to squeeze out a couple of meaningful lines about this issue. |
Ridiculous comparison. Failing to develop this feature is nothing like spitting on the floor. If you really want it you can achieve it with a workaround — or bone up, learn the codebase, and make your own PR!
I’m surprised that there hasn’t evolved a kind of feature bounty system for FOSS where users can vote with their wallet about which features to support or prioritise…
…On Thu, Jan 11, 2024 at 02:32, Aleksandr Sergeev ***@***.***(mailto:On Thu, Jan 11, 2024 at 02:32, Aleksandr Sergeev <<a href=)> wrote:
***@***.***(https://github.com/rawtaz), talking about how people, who trusted you, feel does not go beyond the bounds of decency. You cannot remain silent for several years and expect that no one will develop decadent moods. And if you are such a caring comrade, then remind the author that he is not in a coma, like racer Michael Schumacher, and is able to squeeze out at least a couple of lines of text about what he thinks about our wishes on this issue.
—
Reply to this email directly, [view it on GitHub](#662 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AIMH2NPNU6EEE7DNCNQGWALYN2YABAVCNFSM4CVNONQ2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBYGUYDQMRWGYZQ).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I do not support any kind of personal attacks
To make a PR one needs to put in a considerable effort, which is completely unjustified, when there is a good chance of your PR being summarily closed, or simply left unattended. If you do not agree in principle on the content of your PR beforehand there is a good chance for that. The worst case, is that you are asked to do a bunch of changes, you do them, and then the reviewer disappears for two years. (Note: I think it's fine to disappear for two years, there are always personal circumstances, what I'm trying to say, is that since this is a real possibility, it should be accounted for by someone putting forward a PR.) It is much better to discuss a proposed PR here first, get an agreement in principle, and then proceed with the PR. But this unfortunately is not happening either. |
Anyway -- I find that it doesn't matter for my use case. I didn't want all the annoying blank entries... but just now I used it in EXACTLY the circumstance I thought I would (thought I accidentally rm rfed a folder I shouldn't have -- whoops) and I opened up this other amazing piece of (FREE) software https://github.com/emuell/restic-browser, looked at the time a minute ago and viola, solved my problem. So yeah, it's kind of annoying but I think that is just OCD kicking in. I'm sure there are more important pieces of functionality the devs could be working on. |
I would be very interested in having a flag on The above would be useful for me as the snapshot list would give me a clear signal of 'when' changes to my folder happened, as supposed to an "everyday is a new snapshot regardless of changes or not" situation. |
Before the discussion here spirals again out of control, let's do the following: Add an option The proof-of-concept code at ignus2@7ebee9d is only usable to show the idea, but has to be reimplemented from scratch (e.g. there is no longer a need for the archiver to load a snapshot). |
FWIW and for anyone interested, I've since written a small ruby script that suites my needs: https://gist.github.com/Folling/7c9c35588becd69c7c6fa8d9c880e837 I've adjusted this without testing as the original is a bit more complex with some error-handling and notification logic, use at your own risk or as a base for customization. |
I wanted to switch to restic because of the possibilities deduplication and --keep... give. But This is supposed to be the intended behaviour? Since everybody is using cron or something similar, why have Maybe the solution is not 'not creating a backup', but having something along the lines of This could even be build upon with a couple of flags to specify what exactly is meant by not changed |
I've implemented the option in #4816.
The usual approach is to have a limited amount of daily snapshots combined with a few dozen weekly / monthly snapshots and a few yearly ones. But I guess it depends a lot on the use case. Backups of a folder that rarely changes might benefit from only creating snapshots if something actually changed.
A |
Fully agree. Simply not creating a new backup, if nothing changed, would set all those discussions on semantics and change filtering moot. |
Feature request/discussion about implementing a switch that omits snapshot creation if there was no change in metadata, and data.
From IRC:
The text was updated successfully, but these errors were encountered: