NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
InteXX
Dec 20, 2020Luminary
Scripting the snapshots (RN626X, RN516, RN316, RN204, etc.)
I'm interested in recovering all changed files on our RN316. This is the current model under discussion, but the concept is relevant to any ReadyNAS device running OS 6.* (or maybe more, for that mat...
- Dec 20, 2020
InteXX wrote:
This will of course result in the loss of our volume.
As rn_enthusiast says, it normally won't result in loss of the volume (unless you are planning to destroy it for some reason, or are wanting to do a factory reset).
So you should first sort out if you really need to do this.
InteXX wrote:
Is it simply a matter of looping through the files in these snapshot folders and comparing each file's metadata with the same from the previous snapshot? It sure looks like it. If so, my task ends up being a lot easier than I'd originally considered when I started discussing the notion with everyone.
Each snapshot shows the full contents of the share at the time the snapshot was taken - including the metadata. So you could just compare file dates (and maybe size) with the previous (or next) snapshot. Of course you also need to be handling deletions and adds.
Any tool that allows you to diff two different folders should be usable for this (though tools that actually compare the files would work very slowly).
Is your goal to recreate the snapshots on the new volume?
StephenB
Dec 20, 2020Guru
InteXX wrote:
This will of course result in the loss of our volume.
As rn_enthusiast says, it normally won't result in loss of the volume (unless you are planning to destroy it for some reason, or are wanting to do a factory reset).
So you should first sort out if you really need to do this.
InteXX wrote:
Is it simply a matter of looping through the files in these snapshot folders and comparing each file's metadata with the same from the previous snapshot? It sure looks like it. If so, my task ends up being a lot easier than I'd originally considered when I started discussing the notion with everyone.
Each snapshot shows the full contents of the share at the time the snapshot was taken - including the metadata. So you could just compare file dates (and maybe size) with the previous (or next) snapshot. Of course you also need to be handling deletions and adds.
Any tool that allows you to diff two different folders should be usable for this (though tools that actually compare the files would work very slowly).
Is your goal to recreate the snapshots on the new volume?
InteXX
Dec 20, 2020Luminary
unless you are planning to destroy it for some reason
Yes, such is the case. The RN316 that's presently holding these six weeks worth of snapshots ultimately will be traveling offsite to become a mirror of our onsite RN626X. But we want to recover that history before we recreate the volume with the new larger drives. (This is new info, I realize, but I didn't feel it relevant to the scripting question. I didn't want to stray too far off-topic before I even got started.)
So you should first sort out if you really need to do this.
I have and I do. I'm pretty sure.
Each snapshot shows the full contents of the share at the time the snapshot was taken - including the metadata
Bingo. That's exactly what I wanted to hear. It looked like that very thing to me at first glance, but your second opinion makes for a wonderful confirmation. Thank you.
Of course you also need to be handling deletions and adds.
Yes, that complicates matters significantly. But I'm confident I'll get it worked out. Twenty-five years of software development can't have gone to complete waste ;-)
Is your goal to recreate the snapshots on the new volume?
I didn't think that was possible. Could you elaborate?
Thanks,
Jeff Bowman
Fairbanks, Alaska
- StephenBDec 21, 2020Guru
InteXX wrote:
Is your goal to recreate the snapshots on the new volume?
I didn't think that was possible. Could you elaborate?
I was just trying to understand your intent (that is, whether capturing the changed files in the snapshot was the only thing you wanted to do).
Back on the main topic - you might be able to use btrfs send/receive to extract the incremental changes in each snapshot. That's not something I've ever played with though. You might check out this page if you want to explore that path: https://btrfs.wiki.kernel.org/index.php/Incremental_Backup
- InteXXDec 21, 2020Luminary
StephenB wrote:I was just trying to understand your intent (that is, whether capturing the changed files in the snapshot was the only thing you wanted to do).
Ah, OK. Gotcha.
StephenB wrote:you might be able to use btrfs send/receive to extract the incremental changes in each snapshot
That looks interesting—thanks for the link.
Thanks,
Jeff Bowman
Fairbanks, Alaska
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!