I eventually found the time to upload it to GH so here it is: https://github.com/tgerczei/zfs-backup
I don't consider it production-ready but it's been serving me well so far. I'd be delighted to know if it helped You! Tamás Jeb Winders wrote: > Thanks, I also had such a script from my solaris 10 days but never > transferred it over to smartos. Please feel free to share. > > On Wed, Oct 14, 2015 at 6:58 AM, Gérczei Tamás <[email protected] > <mailto:[email protected]>> wrote: > > I have created my own solution for this in the form of a shell > script that can create, replicate and rotate ZFS snapshots, suitable > for use as a cronjob. . I'm using it on Solaris (1[01]) and SmartOS > as well although in test environments only so far. I can share it, > if You want me to, it might prove helpful until someone comes up > with a better one. > > On 14 October 2015 12:43:52 pm "Jeb Winders" <[email protected] > <mailto:[email protected]>> wrote: > >> Agreed. Snapshots would have been an easy way to mitigate this >> but implementing some auto snapshoting was one of the things on my >> todo list that I embarrassingly never got around to doing. I do >> have one snapshot from 2012 which has a lot in it so there is some >> recoverability. >> >> Another funny part of this is that I was actually pretty good >> about doing scrubs because I was always worried about the dreaded >> bit rot. But I obviously did not take enough precautions against >> user error. >> >> >> >> On Tue, Oct 13, 2015 at 10:59 PM, Michael Loftis >> <[email protected] <mailto:[email protected]>> wrote: >> >> A snapshot created before you started down this path would >> save your butt here but beyond that I dunno...snapshots are >> cheap to the point of being free with zfs so if you're not >> routinely snapshot ting everything hopefully you'll start now. >> >> >> On Tuesday, October 13, 2015, Jeb Winders >> <[email protected] <mailto:[email protected]>> wrote: >> >> Hello All, >> >> First let me say that I greatly appreciate the work the >> community and joyent have done on smartos. I am a big fan. >> >> I know that my subject may seem provocative and I don't >> really mean it that way, but on the other hand my files >> seem to be gone so maybe a smidge of provocation is in order. >> >> I do things that I probably should not like running the >> 2012Q2 release since, well second quarter 2012. >> >> When I started using smartos I had big plans to do all the >> zones stuff I used to do on sol10 and opensolaris but one >> thing led to another and I ended up mostly just running a >> zfs fs in the global zone as a place to dump files until I >> made time to really get into it. >> >> Well this past weekend the time finally came. After much >> investigation and trial and error, I figured out that I >> had goobered up the old smartos64plus zones I had made >> previously. Instead of trying to fix them I went ahead >> and downloaded the latest usb image so I could get with >> the modern age, be on the cutting edge, right side of >> history, all that stuff. >> >> While I was waiting for things to 'dd' I rearranged some >> of the files and dirs in my global zone zfs fs to kill >> time and then got to rebooting. >> >> I then ran into the whole 'zones/dump' pool degraded issue >> but I eventually find the guy who documented destroying >> and remaking the dump zfs and things were undegraded again. >> >> I made a working zone , got some stuff from pkgin, >> everything was going swimmingly. >> >> I mention all of the above to illustrate that smartos and >> I had a big weekend. >> >> Then I went to retrieve some files from my old global zone >> zfs filesystem and all but two of the directories there >> were gone. Specifically everything but the dirs I had >> been rearranging were gone. >> >> 10 points to whomever has already figured out what happened >> >> At first I thought there was some kind of zpool something >> or other happening cause I had just gotten over that whole >> 'degraded' scare the day before. But zpool stuff doesn't >> usually leave some files intact and visible and the fs >> mounted. >> >> Here is a hint -- back in 2012 when I made this fs to dump >> files into I obviously could not call it zones/dump >> because that was already taken. so the next best thing I >> could think of that was not in use already was ... wait >> for it ... zones/archive >> >> 5 points if you get it now. >> >> For those of you still reading, evidently zones/archive is >> an actual thing now and there is a handy cron job in the >> root crontab to find everything in there which has not >> been touched in 7 days and 'rm' it. >> >> so my dir full of linux iso's avoided certain doom, for >> now. but everything else got 'rm'd >> >> I realize this is an edge case and I shouldn't be putting >> stuff in the global zone in the first place but if anyone >> has any advice for undeleting files from zfs I would >> greatly appreciate it. >> >> I wanted to learn more hardcore OS and filesystem stuff so >> I guess I get my wish :) >> >> Another question -- should I rename my zfs fs >> zones/archive to something else or would that make it >> harder to recover stuff ? >> >> or am I just deluding myself to think there will be any >> recovery ? >> >> Thanks for any help you can render. In the mean time I >> will make a shell script to touch the dirs in >> zones/archive everyday. >> >> And let my story serve as a caution to any wayward soul >> who would make a filesystem in the global zone. >> >> -jeb >> >> >> >> >> -- >> >> "Genius might be described as a supreme capacity for getting >> its possessors >> into trouble of all kinds." >> -- Samuel Butler >> >> > > *smartos-discuss* | Archives > <https://www.listbox.com/member/archive/184463/=now> > <https://www.listbox.com/member/archive/rss/184463/24816784-76c8a057> | > Modify > <https://www.listbox.com/member/?&> > Your Subscription [Powered by Listbox] <http://www.listbox.com> > ------------------------------------------- smartos-discuss Archives: https://www.listbox.com/member/archive/184463/=now RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00 Modify Your Subscription: https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb Powered by Listbox: http://www.listbox.com
