-
Notifications
You must be signed in to change notification settings - Fork 0
/
_tmutil
79 lines (75 loc) · 3.57 KB
/
_tmutil
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
#compdef tmutil
local subcommands=(
"version:Show program version"
"enable:Turn on automatic backups"
"disable:Turn off automatic backups"
"startbackup:Begin a backup if one is not already running"
"stopbackup:Cancel a backup currently in progress"
"delete:Deletes the backups with the specified timestamp from the backup volume mounted at the specified mountpoint"
"deleteinprogress:Delete all in-progress backups for a machine directory"
"restore:Restore the item src, which is inside a backup, to the location dst"
"compare:Perform a backup diff"
"setdestination:Configure a local HFS+ or APFS volume, AFP share, or SMB share as a backup destination"
"removedestination:Remove the destination with the specified unique identifier from the Time Machine configuration"
"destinationinfo:Print information about destinations currently configured for use with Time Machine"
"addexclusion:Configure an exclusion that tells Time Machine not to back up a file, directory, or volume during future backups"
"removeexclusion:Configure Time Machine to back up a file, directory, or volume during future backups"
"isexcluded:Determine if a file, directory, or volume are excluded from Time Machine backups"
"inheritbackup:Claim a machine directory or sparsebundle for use by the current machine"
"associatedisk:Bind a volume store directory to the specified local disk, thereby reconfiguring the backup history"
"latestbackup:List this computer's latest completed backup"
"listbackups:List all of this computer's completed backups"
"machinedirectory:Print the path to the current machine directory for this computer"
"calculatedrift:Analyze the backups in an HFS machine directory and determine the amount of change between each"
"uniquesize:Analyze the specified path in an HFS+ backup or path to an APFS backup and determine its unique size."
"verifychecksums:Compute a checksum of data contained within a backup"
"localsnapshot:Create new local Time Machine snapshots of all APFS volumes included in the Time Machine backup"
"listlocalsnapshots:List local Time Machine snapshots of the specified volume"
"listlocalsnapshotdates:List the creation dates of all local Time Machine snapshots"
"deletelocalsnapshots:If a date is specified, delete all local Time Machine snapshots on all mounted disks for the specified date"
"thinlocalsnapshots:Thin local Time Machine snapshots for the specified volume"
)
_arguments \
"1: :{_describe 'command' subcommands }" \
"*:: :->args"
case $state in
args)
case $words[1] in
addexclusion)
_arguments \
-p"[Configure fixed-path exclusion]" \
-v"[Configure volume exclusion]" \
"*:item:_files"
;;
destinationinfo)
_arguments "-X[Print output in XML property list format]"
;;
isexcluded)
_arguments \
"-X[Print output in XML property list format]" \
"*:item:_files"
;;
restore)
_arguments "*::path:_files -/"
;;
setdestination)
_arguments \
"-a[Append arg]" \
"-p[Prompt for password interactively]"
;;
startbackup)
_arguments \
'(-a --auto)'{-a,--auto}"[Run the backup in a mode similar to system-scheduled backup]" \
'(-r --rotation)'{-r,--rotation}"[Allow automatic destination rotation during the backup]" \
'(-d --destination)'{-d,--destintation}"[Perform the backup to the destination corresponding to the specified ID]:dest_id" \
'(-b --block)'{-b,--block}"[Wait (block) until the backup is finished before exiting]"
;;
listlocalsnapshots|uniquesize|verifychecksums)
_arguments "*:path:_files -/"
;;
listlocalsnapshotdates)
_arguments "*::path:_files -/"
;;
esac
;;
esac