zfs_mgmt 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +84 -0
- data/lib/zfs_mgmt/version.rb +1 -1
- data/lib/zfs_mgmt/zfs.rb +25 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e73c176eec63da1a833242e1f09ee49a9d32b916504a3df52e5c367e00d4478
|
|
4
|
+
data.tar.gz: 2e5e6391672e899a6c536bf8cbf0042d5b3102b6e54ccb9da456aeb8f334fb35
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af7bb076d3fd289c1fef89ac9a9727c528e5cfd044548b9d327da9efe68d44713acad4ea052ada422eb117e2fd74767608a56829bf877d544892cb090e10b587
|
|
7
|
+
data.tar.gz: b0d56435a2005556e7d28c1f4f9d3752c2c39f6f6b21a39d686902fe8e1198e69aa15850045c20378c5930e4ba17b5bed12a2283e302eecc64d35f13a8979c62
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
zfs_mgmt (0.7.
|
|
4
|
+
zfs_mgmt (0.7.3)
|
|
5
5
|
easy_talk
|
|
6
6
|
filesize (~> 0.2)
|
|
7
7
|
pstore
|
|
@@ -46,14 +46,14 @@ GEM
|
|
|
46
46
|
character_set (~> 1.4)
|
|
47
47
|
regexp_parser (~> 2.11)
|
|
48
48
|
regexp_property_values (~> 1.0)
|
|
49
|
-
json (3.
|
|
49
|
+
json (3.2.0)
|
|
50
50
|
language_server-protocol (3.17.0.6)
|
|
51
51
|
logger (1.7.0)
|
|
52
52
|
minitest (6.1.0)
|
|
53
53
|
drb (~> 2.0)
|
|
54
54
|
prism (>= 1.5, < 3)
|
|
55
55
|
prism (1.9.0)
|
|
56
|
-
pstore (0.
|
|
56
|
+
pstore (0.3.0)
|
|
57
57
|
rake (13.4.2)
|
|
58
58
|
rbs (4.2.0)
|
|
59
59
|
logger
|
|
@@ -85,7 +85,7 @@ GEM
|
|
|
85
85
|
simplecov_json_formatter (~> 0.1)
|
|
86
86
|
simplecov-html (0.13.2)
|
|
87
87
|
simplecov_json_formatter (0.1.4)
|
|
88
|
-
sorbet-runtime (0.6.
|
|
88
|
+
sorbet-runtime (0.6.13724)
|
|
89
89
|
text-table (1.2.4)
|
|
90
90
|
thor (1.5.0)
|
|
91
91
|
timeout (0.6.1)
|
data/README.md
CHANGED
|
@@ -219,6 +219,90 @@ create snapshots called autosnap-%FT%T%z.
|
|
|
219
219
|
strftime format string used when creating snapshot names, default
|
|
220
220
|
being %FT%T%z.
|
|
221
221
|
|
|
222
|
+
### zfsmgmt:send
|
|
223
|
+
Enable `zfs send` for this dataset. Accepts boolean values (`true`/`on`)
|
|
224
|
+
or `'local'`:
|
|
225
|
+
- `true` or `on`: enables `zfs send` when the property's ZFS source is
|
|
226
|
+
`local` or `inherited`, and disables it when the source is `received`
|
|
227
|
+
or when `zfsmgmt:send_replicate` is inherited from an ancestor.
|
|
228
|
+
- `local`: enables `zfs send` only when the property's ZFS source is
|
|
229
|
+
`local` (not inherited or received).
|
|
230
|
+
|
|
231
|
+
### zfsmgmt:remote
|
|
232
|
+
Remote SSH target for `zfs recv` and remote `zfs get` checks (e.g.
|
|
233
|
+
`user@host`). When omitted, `zfs recv` runs locally.
|
|
234
|
+
|
|
235
|
+
### zfsmgmt:destination
|
|
236
|
+
Base destination ZFS dataset path for `zfs send`/`recv` (required for
|
|
237
|
+
`zfsmgr send all`, even if `--destination` is passed on the command
|
|
238
|
+
line):
|
|
239
|
+
- When the property's ZFS source is `local`, the destination path
|
|
240
|
+
resolves to `<destination>/<dataset basename>`.
|
|
241
|
+
- When the property's ZFS source is `inherited from <ancestor>`, the
|
|
242
|
+
destination path resolves to
|
|
243
|
+
`<destination>/<ancestor basename>/<relative path>`.
|
|
244
|
+
- When the source is `received` (or unrecognized), no destination is
|
|
245
|
+
resolved.
|
|
246
|
+
|
|
247
|
+
### zfsmgmt:send_intermediary (default: false)
|
|
248
|
+
Boolean (`true`/`on`). Pass `-I` (include intermediary snapshots) to
|
|
249
|
+
`zfs send`.
|
|
250
|
+
|
|
251
|
+
### zfsmgmt:send_backup (default: false)
|
|
252
|
+
Boolean (`true`/`on`). Pass `-b` (send received property values) to
|
|
253
|
+
`zfs send`.
|
|
254
|
+
|
|
255
|
+
### zfsmgmt:send_compressed (default: false)
|
|
256
|
+
Boolean (`true`/`on`). Pass `-c` (send compressed blocks) to `zfs send`.
|
|
257
|
+
|
|
258
|
+
### zfsmgmt:send_embed (default: false)
|
|
259
|
+
Boolean (`true`/`on`). Pass `-e` (send embedded data) to `zfs send`.
|
|
260
|
+
|
|
261
|
+
### zfsmgmt:send_holds (default: false)
|
|
262
|
+
Boolean (`true`/`on`). Pass `-h` (send snapshot holds) to `zfs send`.
|
|
263
|
+
|
|
264
|
+
### zfsmgmt:send_large_block (default: false)
|
|
265
|
+
Boolean (`true`/`on`). Pass `-L` (allow large blocks) to `zfs send`.
|
|
266
|
+
|
|
267
|
+
### zfsmgmt:send_props (default: false)
|
|
268
|
+
Boolean (`true`/`on`). Pass `-p` (send properties) to `zfs send`.
|
|
269
|
+
|
|
270
|
+
### zfsmgmt:send_raw (default: false)
|
|
271
|
+
Boolean (`true`/`on`). Pass `-w` (send raw encrypted stream) to
|
|
272
|
+
`zfs send`.
|
|
273
|
+
|
|
274
|
+
### zfsmgmt:send_replicate (default: false)
|
|
275
|
+
Boolean (`true`/`on`). Pass `-R` (replication stream) to `zfs send` and
|
|
276
|
+
use the newest snapshot for initial send. Only takes effect on the
|
|
277
|
+
dataset where `zfsmgmt:send_replicate` is `local`; descendant datasets
|
|
278
|
+
inheriting it have both `send` and `send_replicate` disabled so they are
|
|
279
|
+
not sent separately.
|
|
280
|
+
|
|
281
|
+
### zfsmgmt:recv_state (default: true)
|
|
282
|
+
Boolean. Pass `-s` (save partial receive state for resuming) to
|
|
283
|
+
`zfs recv`. Enabled by default unless set to `false` or `off` (or
|
|
284
|
+
overridden on the CLI).
|
|
285
|
+
|
|
286
|
+
### zfsmgmt:recv_noop (default: false)
|
|
287
|
+
Boolean (`true`/`on`). Pass `-n` (dry-run / do not actually receive) to
|
|
288
|
+
`zfs recv`.
|
|
289
|
+
|
|
290
|
+
### zfsmgmt:recv_drop_holds (default: false)
|
|
291
|
+
Boolean (`true`/`on`). Pass `-h` (skip receiving holds) to `zfs recv`.
|
|
292
|
+
|
|
293
|
+
### zfsmgmt:recv_unmount (default: false)
|
|
294
|
+
Boolean (`true`/`on`). Pass `-u` (do not mount received filesystem) to
|
|
295
|
+
`zfs recv`.
|
|
296
|
+
|
|
297
|
+
### zfsmgmt:recv_discard_first (default: false)
|
|
298
|
+
Boolean (`true`/`on`). Pass `-d` (discard the first element of the sent
|
|
299
|
+
snapshot's filesystem name) to `zfs recv`, passing the base
|
|
300
|
+
`zfsmgmt:destination` (or `--destination`) as the `zfs recv` target and
|
|
301
|
+
stripping the first path element for remote existence/snapshot checks.
|
|
302
|
+
|
|
303
|
+
### zfsmgmt:recv_force (default: false)
|
|
304
|
+
Boolean (`true`/`on`). Pass `-F` (force rollback) to `zfs recv`.
|
|
305
|
+
|
|
222
306
|
### zfsmgmt:restic_backup
|
|
223
307
|
boolean, send this zfs to restic
|
|
224
308
|
|
data/lib/zfs_mgmt/version.rb
CHANGED
data/lib/zfs_mgmt/zfs.rb
CHANGED
|
@@ -24,6 +24,18 @@ module ZfsMgmt
|
|
|
24
24
|
recv_force
|
|
25
25
|
].freeze
|
|
26
26
|
|
|
27
|
+
VALID_ZFS_PROPS = (
|
|
28
|
+
%w[
|
|
29
|
+
manage policy strategy minage matchsnaps ignoresnaps prefersnaps
|
|
30
|
+
snapshot snap_prefix snap_timestamp
|
|
31
|
+
send remote destination send_replicate
|
|
32
|
+
recv_state
|
|
33
|
+
restic_backup restic_repository
|
|
34
|
+
] +
|
|
35
|
+
SEND_BOOL_PROPS.map(&:to_s) +
|
|
36
|
+
RECV_BOOL_PROPS.map(&:to_s)
|
|
37
|
+
).map { |p| "zfsmgmt:#{p}" }.freeze
|
|
38
|
+
|
|
27
39
|
define_schema do
|
|
28
40
|
title 'Zfs'
|
|
29
41
|
description 'Encapsulates zfsmgmt:* user properties for a ZFS dataset'
|
|
@@ -173,8 +185,21 @@ module ZfsMgmt
|
|
|
173
185
|
rel && !rel.empty? ? File.join(base, rel) : base
|
|
174
186
|
end
|
|
175
187
|
|
|
188
|
+
def self.warn_unknown_zfs_props(name, props)
|
|
189
|
+
props.each_key do |key|
|
|
190
|
+
key_str = key.to_s
|
|
191
|
+
next unless key_str.start_with?('zfsmgmt:')
|
|
192
|
+
next if key_str.end_with?('@source')
|
|
193
|
+
next if VALID_ZFS_PROPS.include?(key_str)
|
|
194
|
+
|
|
195
|
+
target = name.nil? || name.empty? ? '' : " on #{name}"
|
|
196
|
+
$logger&.warn("unknown zfsmgmt property '#{key_str}'#{target}")
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
176
200
|
def self.from_zfs_props(name, props = {})
|
|
177
201
|
props ||= {}
|
|
202
|
+
warn_unknown_zfs_props(name, props)
|
|
178
203
|
attrs = { name: name }
|
|
179
204
|
attrs[:type] = props['type'] if props.key?('type')
|
|
180
205
|
|