1 |
On Tuesday, August 14, 2018 10:52:30 PM CEST John Covici wrote: |
2 |
> On Tue, 14 Aug 2018 16:06:21 -0400, |
3 |
> |
4 |
> J. Roeleveld wrote: |
5 |
> > On August 14, 2018 11:42:18 AM UTC, John Covici <covici@××××××××××.com> |
6 |
wrote: |
7 |
> > >I use sanoid/syncoid to back up using zfs. Its great, keeps snapshots |
8 |
> > >for as long as I want them (I use 80 days for now). And it keeps |
9 |
> > >hourlies for the last couple of days as well, so I could roll back in |
10 |
> > >case of a problem. Very nice if you use zfs. |
11 |
> > |
12 |
> > I tried sanoid, but it has a few problems which really become annoying |
13 |
> > when you have a lot of datasets: 1) every dataset is handled seperately, |
14 |
> > no use of recursive snapshots when datasets are inside the same tree 2) |
15 |
> > it keeps seperate hourly, daily,.... snapshots, which means it will |
16 |
> > happily create multiple snapshots with only a few seconds difference for |
17 |
> > every dataset around midnight. 3) when rolling back several snapshots, |
18 |
> > there are multiple errors reported because the cache (where does it store |
19 |
> > that?) does not match reality. |
20 |
> > |
21 |
> > Have these been resolved yet? |
22 |
> > |
23 |
> > I ended up writing my own system for this, got some extra intelligence in |
24 |
> > there to work around any possible error condition I have encountered. |
25 |
> Well, I got around your second point by having a special job at 11:59 |
26 |
> pm to create the dailies and the one at midnight works well. I only |
27 |
> do the cron jobs hourly, not every minute like they wanted. |
28 |
> |
29 |
> If your script is not special for you, I would like to see it, maybe I |
30 |
> would use it instead. Things seem to work for now, however with those |
31 |
> modifications. |
32 |
|
33 |
Current code is too specific for my situation. I think you would be quicker to |
34 |
write something yourself instead of modifying my code. |
35 |
|
36 |
The steps are: |
37 |
- Check if an snapshot needs to be done (incl. type: hourly, daily, weekly, |
38 |
monthly) |
39 |
- If yes: |
40 |
1) create a recursive snapshot on the entire pool |
41 |
2) remove unnecessary snapshots (temp, swap, |
42 |
placeholders,not_for_current_type) |
43 |
3) register snapshots into database |
44 |
4) clean up old snapshots |
45 |
|
46 |
Because I register actual snapshots and point snapshot-type entries to these, |
47 |
I can quickly determine which snapshots are really unecessary. This also |
48 |
drastically reduces the amount of snapshots on the system. (My SAN currently |
49 |
has 2611 ZFS snapshots). |
50 |
|
51 |
I also found it is far quicker to create a recursive snapshot on the entire |
52 |
pool and then removing all the unecessarily created ones. |
53 |
|
54 |
-- |
55 |
Joost |