-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathtmutil.ts
316 lines (315 loc) · 10.2 KB
/
tmutil.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
const completionSpec: Fig.Spec = {
name: "tmutil",
description: "Time Machine utility",
subcommands: [
{ name: "version", description: "Print the current version" },
{
name: "enable",
description:
"Turn on automatic backups (required root + full disk access)",
},
{
name: "disable",
description:
"Turn off automatic backups (required root + full disk access)",
},
{
name: "startbackup",
description: "Begin a backup if one is not already running",
options: [
{
name: ["-a", "--auto"],
description:
"Run the backup in a mode similar to system-scheduled backups",
},
{
name: ["-b", "--block"],
description:
"Wait (block) until the backup is finished before exiting",
},
{
name: ["-r", "--rotation"],
description: "Allow automatic destination rotation during backup",
},
{
name: ["-d", "--destination"],
description:
"Perform the backup to the destination corresponding to the specified ID",
args: { name: "destination id" },
},
],
},
{
name: "stopbackup",
description: "Cancel a backup currently in progress",
},
{
name: "delete",
description:
"Deletes backups with the specified timestamp from the backup volume mounted at the given mountpoint",
options: [
{
name: "-d",
description: "Delete from the given mount point",
args: { name: "backup mount point" },
},
{
name: "-t",
description: "Delete backups with this timestamp",
isRepeatable: true,
args: { name: "timestamp" },
},
{
name: "-p",
description: "A specific path to delete (HFS backup disk)",
args: { name: "path", template: ["filepaths", "folders"] },
},
],
},
{
name: "deleteinprogress",
description: "Delete all in-progress backups for a machine directory",
args: { name: "machine directory" },
},
{
name: "restore",
description:
"Restore the item `source`, which is inside a backup, to the location `destination`. Same semantics as `cp`",
args: [{ name: "source", isVariadic: true }, { name: "destination" }],
options: [
{
name: "-v",
description: "Be verbose, showing files as they are copied",
},
],
},
{
name: "compare",
description: "Perform a backup diff",
args: [
{ name: "backup or path" },
{ name: "path (if not backup)", isOptional: true },
],
options: [
{ name: "-@", description: "Compare extended attributes" },
{ name: "-a", description: "Compare all supported metadata" },
{ name: "-c", description: "Compare creation times" },
{ name: "-d", description: "Compare file data forks" },
{ name: "-e", description: "Compare ACLs" },
{ name: "-f", description: "Compare file flags" },
{ name: "-g", description: "Compare GIDs" },
{ name: "-h", description: "Unknown" },
{ name: "-l", description: "Unknown" },
{ name: "-m", description: "Compare file modes" },
{ name: "-n", description: "No metadata comparison" },
{ name: "-s", description: "Compare sizes" },
{ name: "-t", description: "Compare modification times" },
{ name: "-u", description: "Compare UIDs" },
{
name: "-E",
description:
"Don't take exclusions into account when comparing items inside volumes",
},
{
name: "-U",
description:
"Ignore logical volume identity (volume UUIDs) when directly comparing a local volume or volume store to a volume store",
},
{ name: "-X", description: "Print output in XML property list format" },
{
name: "-D",
description:
"Limit traversal depth to depth levels from the beginning of iteration",
args: { name: "depth" },
},
{
name: "-I",
description:
"Ignore paths with a path component equal to name during iteration",
isRepeatable: true,
args: { name: "name" },
},
],
},
{
name: "setdestination",
description:
"Configure a local HFS+ or APFS volume, AFP share, or SMB share as a backup destination (requires root + Full Disk Access)",
args: { name: "destination" },
options: [
{
name: "-a",
description:
"Add the arg to the list of destinations, instead of replacing the list",
},
{
name: "-p",
description: "Enter a password in a non-echoing interactive prompt",
},
],
},
{
name: "removedestination",
description:
"Remove the destination with the specified unique identifier from the Time Machine configuration (requires root + Full Disk Access)",
args: { name: "destination id" },
},
{
name: "destinationinfo",
description:
"Print information about destinations currently configured for use with Time Machine",
options: [
{ name: "-X", description: "Print output in XML plist format" },
],
},
{
name: "addexclusion",
description:
"Configure an exclusion that tells Time Machine not to backup a file, directory, or volume during future backups",
args: { name: "item", isVariadic: true },
options: [
{ name: "-p", description: "Configure fixed-path exclusions" },
{ name: "-v", description: "Configure volume exclusions" },
],
},
{
name: "removeexclusion",
description:
"Configure Time Machine to backup a file, directory, or volume during future backups",
args: { name: "item", isVariadic: true },
options: [
{ name: "-p", description: "Configure fixed-path exclusions" },
{ name: "-v", description: "Configure volume exclusions" },
],
},
{
name: "isexcluded",
description:
"Determine if a file, directory, or volume are excluded from Time Machine backups",
args: { name: "item", isVariadic: true },
},
{
name: "inheritbackup",
description:
"Claim a machine directory or sparsebundle for use by the current machine",
args: { name: "machine directory or sparsebundle" },
},
{
name: "associatedisk",
description:
"Bind a volume store directory to the specified local disk, thereby reconfiguring the backup history (requires root + Full Disk Access)",
args: [{ name: "mount point" }, { name: "volume backup directory" }],
options: [
{
name: "-a",
description:
"Find all volume stores in the same machine directory that match the identity of the volume backup directory",
},
],
},
{
name: "latestbackup",
description: "List this computer's latest completed backup",
options: [
{
name: "-d",
description: "Specify a destination volume to list backups from",
},
{
name: "-m",
dependsOn: ["-d"],
description:
"Attempt to mount the backups and list their mounted paths",
},
{
name: "-t",
dependsOn: ["-m"],
description:
"Only show the backup timestampt rather than the full name or path",
},
],
},
{
name: "listbackups",
description: "List all of this computer's completed backups",
options: [
{
name: "-d",
description: "Specify a destination volume to list backups from",
},
{
name: "-m",
dependsOn: ["-d"],
description:
"Attempt to mount the backups and list their mounted paths",
},
{
name: "-t",
dependsOn: ["-m"],
description:
"Only show the backup timestampt rather than the full name or path",
},
],
},
{
name: "machinedirectory",
description:
"Print the path to the current machine directory for this computer",
},
{
name: "calculatedrift",
description:
"Analyze the backups in an HFS machine directory and determine the amount of change between each",
args: { name: "machine directory" },
},
{
name: "uniquesize",
description:
"Analyze the specified path in an HFS+ backup or path to an APFS backup and determine its unique size",
args: { name: "path", template: "filepaths", isVariadic: true },
},
{
name: "verifychecksums",
description:
"Compute a checksum of data contained within a backup and verify the results against checksum information computed at the time of backup",
args: { name: "path", template: "filepaths", isVariadic: true },
},
{
name: "localsnapshot",
description:
"Create new local Time Machine snapshots of all APFS volumes included in the Time Machine backup",
},
{
name: "listlocalsnapshots",
description: "List local Time Machine snapshots of the specified volume",
args: { name: "mount point" },
},
{
name: "listlocalsnapshotdates",
description:
"List the creation dates of all local Time Machine snapshots",
args: { name: "mount point", isOptional: true },
},
{
name: "deletelocalsnapshots",
description:
"Delete all local Time Machine snapshots on all mounted disks for the specified date or on the given disk",
args: { name: "mount point or snapshot date", isOptional: true },
},
{
name: "thinlocalsnapshots",
description:
"Think local Time Machine snapshots for the specified volume",
args: [
{ name: "mount point" },
{ name: "purge amount (bytes)", isOptional: true },
{
name: "urgency",
isOptional: true,
suggestions: ["1", "2", "3", "4"],
},
],
},
],
};
export default completionSpec;