Advertisement
Guest User

Untitled

a guest
Nov 4th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.73 KB | None | 0 0
  1. TMUTIL(8) BSD System Manager's Manual TMUTIL(8)
  2.  
  3. NAME
  4. tmutil -- Time Machine utility
  5.  
  6. SYNOPSIS
  7. tmutil verb [options]
  8.  
  9. DESCRIPTION
  10. tmutil provides methods of controlling and interacting with Time Machine, as well as examining and manipulating Time Machine backups. Common abilities include restoring data from backups, editing exclusions,
  11. and comparing backups.
  12.  
  13. Several, but not all, verbs require root privileges.
  14.  
  15. BACKUP STRUCTURE
  16. Throughout this manual, specific language is used to describe particular "realms" associated with Time Machine backups. It is important to understand this terminology to make effective use of tmutil and its
  17. manual.
  18.  
  19. backup source
  20. A volume currently being backed up by Time Machine.
  21.  
  22. backup disk
  23. The HFS+ volume that contains Time Machine backups.
  24.  
  25. backup destination
  26. In the case of a local destination, a synonym for backup disk. For network destinations, this is the AFP or SMB share on which the backup disk image resides.
  27.  
  28. backup disk image (or backup image)
  29. A sparsebundle that, when mounted, is the backing store for a volume that is a backup disk.
  30.  
  31. backup store
  32. The top-level "Backups.backupdb" directory at the root of a backup disk. E.g.,
  33.  
  34. /Volumes/Chronoton/Backups.backupdb
  35.  
  36. machine directory
  37. A directory inside a backup store that contains all the backups for a particular computer. For local destinations, a backup store can contain multiple machine directories, all for separate computers.
  38. E.g.,
  39.  
  40. /Volumes/Chronoton/Backups.backupdb/thermopylae
  41.  
  42. snapshot
  43. A directory inside a machine directory that represents a single initial or incremental backup of one computer. The word "snapshot", in most contexts, is a generic term and is not to be confused with a
  44. "local Time Machine snapshot", which is simply a snapshot stored locally on the computer. E.g.,
  45.  
  46. /Volumes/Chronoton/Backups.backupdb/thermopylae/2011-07-03-123456
  47.  
  48. snapshot volume
  49. A directory inside a snapshot that represents a single initial or incremental backup of one backup source. E.g.,
  50.  
  51. /Volumes/Chronoton/Backups.backupdb/thermopylae/2011-07-03-123456/Mac HD
  52.  
  53. VERBS
  54. Each verb is listed with its description and individual arguments.
  55.  
  56. setdestination [-ap] arg
  57. Configure a local HFS+ volume, AFP share, or SMB share as a backup destination. Requires root privileges.
  58.  
  59. When the -a option is provided, arg will be added to the list of destinations. Time Machine will automatically choose a backup destination from the list when performing backups. When the -a option is
  60. not provided, the current list of destinations will be replaced by arg.
  61.  
  62. If you wish to set an HFS+ volume as the backup destination, arg should be the mount point of the volume in question. When setting an AFP or SMB destination arg takes the form:
  63.  
  64. protocol://user[:pass]@host/share
  65.  
  66. In the AFP and SMB cases, the password component of the URL is optional; you may instead specify the -p option to enter the password at a non-echoing interactive prompt. This is of particular interest
  67. to the security-conscious, as all arguments provided to a program are visible by all users on the system via the ps tool.
  68.  
  69. destinationinfo [-X]
  70. Print information about destinations currently configured for use with Time Machine. For each backup destination, the following information may be displayed:
  71.  
  72. Name The volume label as shown in Finder.
  73. Kind Whether the destination is locally attached storage or a network device.
  74. URL In the case of a network destination, the URL used for Time Machine configuration.
  75. Mount Point If the volume is currently mounted, the path in the file system at which it was mounted.
  76. ID The unique identifier for the destination.
  77.  
  78. When more than one destination is configured, the most recent backup destination will be marked with the > indicator.
  79.  
  80. When the -X option is provided, output will be printed in XML property list format.
  81.  
  82. removedestination identifier
  83. Remove the destination with the specified unique identifier from the Time Machine configuration. Requires root privileges.
  84.  
  85. To obtain the unique identifier for a destination, see destinationinfo.
  86.  
  87. addexclusion [-pv] item ...
  88. Configure an exclusion that tells Time Machine not to back up a file, directory, or volume during future backups.
  89.  
  90. There are three kinds of user-configurable exclusions in Time Machine:
  91.  
  92. The first kind of exclusion, which is the default behavior for the addexclusion verb, is a location-independent ("sticky") exclusion that follows a file or directory. When the file or directory is
  93. moved, the exclusion goes with the item to the new location. Additionally, when the item is copied, the copy retains the exclusion.
  94.  
  95. The second kind of exclusion is a fixed-path exclusion. With this, you tell Time Machine that you want a specific path to be excluded, agnostic of the item at that path. If there is no file or direc-
  96. tory at the specified path, the exclusion has no effect; if the item previously at the path has been moved or renamed, the item is not excluded, because it does not currently reside at the excluded
  97. path. As a consequence of these semantics, moving a file or directory to the path will cause the item to be excluded--fixed-path exclusions are not automatically cleaned up when items are moved or
  98. deleted and will take effect again once an item exists at an excluded path.
  99.  
  100. The third kind of exclusion is a volume exclusion. These track volumes based on file system UUID, which is persistent across volume name and mount path changes. Erasing the volume will cause Time
  101. Machine to apply default behavior for the newly erased volume.
  102.  
  103. The -p option configures fixed-path exclusions. The -v option configures volume exclusions. Both require root privileges.
  104.  
  105. removeexclusion [-pv] item ...
  106. Configure Time Machine to back up a file, directory, or volume during future backups. This verb follows the same usage, exclusion style, and privilege semantics as addexclusion.
  107.  
  108. isexcluded [-X] item ...
  109. Determine if a file, directory, or volume are excluded from Time Machine backups.
  110.  
  111. When the -X option is provided, output will be printed in XML property list format.
  112.  
  113. # example output for an excluded item
  114. thermopylae:~ thoth$ tmutil isexcluded /Users/admin/Desktop/foo.txt
  115. [Excluded] /Users/admin/Desktop/foo.txt
  116.  
  117. # example output for an item that is not excluded
  118. thermopylae:~ thoth$ tmutil isexcluded /Users/admin/Desktop/bar.txt
  119. [Included] /Users/admin/Desktop/bar.txt
  120.  
  121. enable
  122. Turn on automatic backups. Requires root privileges.
  123.  
  124. disable
  125. Turn off automatic backups. Requires root privileges.
  126.  
  127. startbackup [-a | --auto] [-b | --block] [-r | --rotation] [-d | --destination dest_id]
  128. Begin a backup if one is not already running.
  129.  
  130. Options:
  131. --auto Run the backup in a mode similar to system-scheduled backups.
  132. --block Wait (block) until the backup is finished before exiting.
  133. --rotation Allow automatic destination rotation during the backup.
  134. --destination Perform the backup to the destination corresponding to the specified ID.
  135.  
  136. The --auto option provides a supported mechanism with which to trigger "automatic-like" backups, similar to automatic backups that are scheduled by the system. While this is not identical to true sys-
  137. tem-scheduled backups, it provides custom schedulers the ability to achieve some (but not all) behavior normally exhibited when operating in automatic mode.
  138.  
  139. stopbackup
  140. Cancel a backup currently in progress.
  141.  
  142. compare [-@acdefglmnstuEUX] [-D depth] [-I name] [snapshot_path | path1 path2]
  143. Perform a backup diff.
  144.  
  145. If no arguments are provided, tmutil will compare the computer to the latest snapshot. If a snapshot path is provided as the sole argument, tmutil will compare the computer to the specified snapshot.
  146. If two path arguments are provided, tmutil will compare those two items to each other. tmutil will attempt to inform you when you have asked it to do something that doesn't make sense or isn't sup-
  147. ported.
  148.  
  149. The compare verb allows you to specify what properties to compare. If you specify no property options, tmutil assumes a default property set of -@gmstu. Specifying any property option overrides the
  150. default set.
  151.  
  152. Options:
  153. -a Compare all supported metadata.
  154. -n No metadata comparison.
  155. -@ Compare extended attributes.
  156. -c Compare creation times.
  157. -d Compare file data forks.
  158. -e Compare ACLs.
  159. -f Compare file flags.
  160. -g Compare GIDs.
  161. -m Compare file modes.
  162. -s Compare sizes.
  163. -t Compare modification times.
  164. -u Compare UIDs.
  165. -D Limit traversal depth to depth levels from the beginning of iteration.
  166. -E Don't take exclusions into account when comparing items inside volumes.
  167. -I Ignore paths with a path component equal to name during iteration. This may be specified multiple times.
  168. -U Ignore logical volume identity (volume UUIDs) when directly comparing a local volume or snapshot volume to a snapshot volume.
  169. -X Print output in XML property list format.
  170.  
  171. verifychecksums path ...
  172. Compute a checksum of data contained within a backup and verify the result(s) against checksum information computed at the time of backup.
  173.  
  174. No output is generated for matching checksums. Issues are reported using the following legend:
  175.  
  176. ! The file's current checksum does not match the expected recorded checksum.
  177. ? The file's recorded checksum is invalid.
  178.  
  179. Beginning in OS X 10.11, Time Machine records checksums of files copied into snapshots. Checksums are not retroactively computed for files that were copied by earlier releases of OS X.
  180.  
  181. restore [-v] src ... dst
  182. Restore the item src, which is inside a snapshot, to the location dst. The dst argument mimics the destination path semantics of the cp tool. You may provide multiple source paths to restore. The last
  183. path argument must be a destination.
  184.  
  185. When using the restore verb, tmutil behaves largely like Finder. Custom Time Machine metadata (extended security and other) will be removed from the restored data, and other metadata will be preserved.
  186.  
  187. Root privileges are not strictly required to perform restores, but tmutil does no permissions preflighting to determine your ability to restore src or its descendants. Therefore, depending on what
  188. you're restoring, you may need root privileges to perform the restore, and you should know this ahead of time. This is the same behavior you would encounter with other copy tools such as cp or ditto.
  189. When restoring with tmutil as root, ownership of the restored items will match the state of the items in the backup.
  190.  
  191. delete path ...
  192. Delete one or more snapshots, machine directories, or backup stores. This verb can delete items from backups that were not made by, or are not claimed by, the current machine. Requires root privileges.
  193.  
  194. latestbackup
  195. Print the path to the most recent snapshot for this computer.
  196.  
  197. listbackups
  198. Print paths for all of this computer's completed snapshots.
  199.  
  200. machinedirectory
  201. Print the path to the current machine directory for this computer.
  202.  
  203. calculatedrift machine_directory
  204. Analyze the snapshots in a machine directory and determine the amount of change between each. Averages are printed after all snapshots have been analyzed. This may require root privileges, depending on
  205. the contents of the machine directory.
  206.  
  207. uniquesize path ...
  208. Analyze the specified path and determine its unique size. The figure reported by uniquesize represents things that only exist in the specified path; things that are hard-linked in other places are not
  209. tallied.
  210.  
  211. inheritbackup {machine_directory | sparsebundle}
  212. Claim a machine directory or sparsebundle for use by the current machine. Requires root privileges.
  213.  
  214. Machine directories and sparsebundles are owned by one computer at a time, and are tracked by unique identifiers rather than computer name, host name, or ethernet address. The inheritbackup verb reas-
  215. signs the identity of the specified item, reconfiguring it so the current host recognizes it during backups. When inheriting a sparsebundle, the machine directory within will also be claimed.
  216.  
  217. Inheriting is typically only one step in the process of configuring a backup for use by a machine. You may also need to use setdestination, associatedisk, or both, depending on the situation.
  218.  
  219. One machine can own multiple machine directories and sparsebundles, but it is ill-advised for them to reside in the same place. In such a situation, which will be chosen during a backup is undefined.
  220. As a result, inheritbackup will attempt to detect possible identity collisions before making changes.
  221.  
  222. associatedisk [-a] mount_point snapshot_volume
  223. Bind a snapshot volume directory to the specified local disk, thereby reconfiguring the backup history. Requires root privileges.
  224.  
  225. In Mac OS X, HFS+ volumes have a persistent UUID that is assigned when the file system is created. Time Machine uses this identifier to make an association between a source volume and a snapshot vol-
  226. ume. Erasing the source volume creates a new file system on the disk, and the previous UUID is not retained. The new UUID causes the source volume -> snapshot volume association to be broken. If one
  227. were just erasing the volume and starting over, it would likely be of no real consequence, and the new UUID would not be a concern; when erasing a volume in order to clone another volume to it, recre-
  228. ating the association may be desired.
  229.  
  230. A concrete example of when and how you would use associatedisk:
  231.  
  232. After having problems with a volume, you decide to erase it and manually restore its contents from a Time Machine backup or copy of another nature. (I.e., not via Time Machine System Restore or Migra-
  233. tion Assistant.) On your next incremental backup, the data will be copied anew, as though none of it had been backed up before. Technically, it is true that the data has not been backed up, given the
  234. new UUID. However, this is probably not what you want Time Machine to do. You would then use associatedisk to reconfigure the backup so it appears that this volume has been backed up previously:
  235.  
  236. thermopylae:~ thoth$ sudo tmutil associatedisk [-a] "/Volumes/MyNewStuffDisk" "/Volumes/Chronoton/Backups.backupdb/thermopylae/Latest/MyStuff"
  237.  
  238. The result of the above command would associate the snapshot volume MyStuff in the specified snapshot with the source volume MyNewStuffDisk. The snapshot volume would also be renamed to match. The -a
  239. option tells associatedisk to find all snapshot volumes in the same machine directory that match the identity of MyStuff, and then perform the association on all of them.
  240.  
  241. enablelocal
  242. Turn on local Time Machine snapshots. Requires root privileges.
  243.  
  244. disablelocal
  245. Turn off local Time Machine snapshots and trigger automatic cleanup of accumulated local snapshot data. Requires root privileges.
  246.  
  247. snapshot
  248. Create new local Time Machine snapshot.
  249.  
  250. EXIT STATUS
  251. In most situations, tmutil exits 0 on success, >0 otherwise.
  252.  
  253. Mac OS X 10 June 2015 Mac OS X
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement