Time Machine (macOS)
Time Machine is a backup software application distributed as part of macOS, desktop operating system developed by Apple. The software is designed to work with AirPort Time Capsule, the Wi-Fi router with built-in hard disk, as well as other internal and external disk drives. It was introduced in Mac OS X Leopard.
Time Machine's Retrieval Interface on OS X 10.10 Yosemite | |
Operating system | macOS 10.5 or newer |
---|---|
Type | Backup software |
Website | www |
Overview
Time Machine creates incremental backups of files that can be restored at a later date.[1] It allows the user to restore the whole system or specific files from the Recovery HD or the macOS Install DVD. It works within Mail, iWork, iLife, and several other compatible programs, making it possible to restore individual objects (e.g. emails, photos, contacts, calendar events) without leaving the application. According to an Apple support statement:
“Time Machine is a backup utility, not an archival utility, it is not intended as offline storage. Time Machine captures the most recent state of your data on your disk. As snapshots age, they are prioritized progressively lower compared to your more recent ones.”[2]
For backups to a network drive, Time Machine allows the user to back up Mac computers over the network, and supports backing up to certain network attached storage devices or servers, depending on the version of Time Machine. Earlier versions worked with a wide variety of NAS servers, but later versions require the server to support a recent version of Apple’s Apple Filing Protocol (AFP), and Time Machine no longer works with servers using earlier versions of the Server Message Block (SMB) protocol[3] typical for Windows servers. Some of the legacy support can be re-enabled by using hand-tuned configuration options, accessed through the Terminal. Apple's Time Capsule acts as a network storage device specifically for Time Machine backups, allowing both wired and wireless backups to the Time Capsule's internal hard drive. Time Machine may also be used with any external or internal volume.
Time Machine saves hourly backups for the past 24 hours, daily backups for the past month, and weekly backups for everything older than a month until the volume runs out of space. At that point, Time Machine deletes the oldest weekly backup.
User interface
Time Machine's user interface when retrieving a file uses Apple's Core Animation API. Upon its launch, Time Machine "floats" the active Finder or application window from the user's desktop to a backdrop depicting the user's blurred desktop wallpaper. Behind the current active window are stacked windows, with each window representing a snapshot of how that folder or application looked on the given date and time in the past. When toggling through the previous snapshots, the stacked windows extend backwards, giving the impression of flying through a "time tunnel." While paging through these "windows from the past," a previous version of the data (or presently deleted data) may be retrieved.
Storage
Time Machine works with locally connected storage disks, which must be formatted in the HFS+ volume format—APFS-formatted won't work,[4] as well as with remote storage media shared from other systems, including Time Capsule, via the network.
When using remote storage, Time Machine uses sparse bundles. This acts as an isolation layer, which makes the storage neutral to the actual file system used by the network server, and also permits the replication of the backup from one storage medium to another. Sparse bundles are mounted by macOS like any other device, presenting their content as a HFS+ formatted volume, functionally similar to a local storage.
Requirements
Time Machine places strict requirements on the backup storage medium. The only officially supported configurations are:
- A hard drive or partition connected directly to the computer, either internally or by a bus like USB or FireWire, and formatted as journaled HFS+.[5]
- A folder on a journaled HFS+ file system shared by another Mac on the same network running at least Leopard.[6]
- A drive shared by an Apple Time Capsule on the same network.
- A drive connected to an Apple AirPort Extreme 802.11ac model on the same network. (Earlier generations of the AirPort Extreme are not supported.)[7]
- Local network volumes connected using the Apple Filing Protocol[7] or via an SMB3 share that advertises a number of capabilities.[3]
On a Time Capsule, the backup data is stored in an HFS+ disk image and accessed via Apple Filing Protocol. Although it is not officially supported, users and manufacturers have configured FreeBSD and Linux servers and network-attached storage systems to serve Time Machine-enabled Macs.[8][9][10][11][12][13][14]
Operation
Time Machine creates a folder on the designated Time Machine volume (local or inside a remote sparse image) into which it copies the directory tree of all locally attached disk drives, except for files and directories that the user has specified to omit, including the Time Machine volume itself. Every hour thereafter, it creates a new subordinate folder and copies only files that have changed since the last backup and creates hard links to files that already exist on the backup drive. A user can browse the directory hierarchy of these copies as if browsing the primary disk.[15]
Some other backup utilities save deltas for file changes, much like version control systems. Such an approach permits more frequent backups of minor changes, but can often complicate the interaction with the backup volume. By contrast, it is possible to manually browse a Time Machine backup volume without using the Time Machine interface; the use of hard links presents each backup to the user as a complete disk copy.[15]
Time Machine creates multiple hard links to unmodified directories.[15] Multiple linking of directories is a peculiar feature for HFS+, and is not supported on modern Unix file systems including Apple's own APFS.[4] As a result, tools like rsync cannot be used to replicate a Time Machine volume; replication can only reliably be done by imaging the entire filesystem.
Apple system events record when each directory is modified on the hard drive. This means that instead of examining every file's modification date when it is activated, Time Machine only needs to scan the directories that changed for files to copy (the remainder being hard-linked). This differs from the approach taken by similar backup utilities rsync and FlyBack, which examine modification dates of all files during backup.
Time Machine is also available in the Leopard, Snow Leopard, and Lion installation process. One of the features in the Migration Assistant interface is to re-install the contents of a Time Machine backup. In other words, a hard drive can be restored from a Time Machine backup in the event of a catastrophic crash.
OS X Mountain Lion introduced the ability to use multiple volumes simultaneously for Time Machine operations. When the user specifies more than one volume to use, macOS rotates among the desired volumes each time it does a backup. [16]
Coding differences between OS X Mountain Lion and Mavericks have resulted in compatibility issues related to Time Machine's system restoration functionality. Time Machine backups created by Apple computers purchased as recently as late 2012 cannot be used for system restoration on 2013 or 2014 models.. However, the data from the backup can still be recovered by directly accessing the files from the Time Machine Volume.
Exclusion
Time Machine supports two forms of exclusion: one based on a user-configured list of paths (plus a set of system defaults), the other based on the extended file attribute com.apple.metadata:com_apple_backup_excludeItem dependencies
. Since the attribute is applied to the file or directory directly, moving or copying will not affect the exclusion. The attribute should contain the string com.apple.backup
in any property list format. Writing com.apple.MobileBackup
instead sets the exclusion for iOS backups.[17]
Google Chrome is known to use the attribute to exclude its histories.[17] Third-party backup applications that respect this setting include CrashPlan and Arq.[18] Apple wraps the attribute into the tmutil
command-line utility[17] as well as a CoreServices API.[19]
See also
- File History
- MobileMe Backup
- List of backup software
- Revision control
- Time Capsule (Apple)
- System Restore
References
- Apple. "Apple - Mac OS X Leopard - Features - Time Machine". Retrieved December 21, 2007.
- "Time Machine keeps saying not enough space | Communities". discussions.apple.com. Retrieved October 21, 2017.
- "Time Machine over SMB Specification". Documentation Archive. Apple Inc. September 13, 2016. Retrieved April 24, 2019.
- Butts, Jeff (September 25, 2017). "Time Machine and APFS: What You Need to Know". The Mac Observer. Retrieved April 23, 2019.
- "Mac OS X 10.6 Help: Disks that can be used with Time Machine". Archived from the original on July 7, 2011.
- Dyce, Richard (October 28, 2009). "New Apple Snow Leopard Server 10.6 review". TechRadar. Retrieved August 12, 2010.
- "Backup disks you can use with Time Machine". Apple Support. Apple, Inc. Retrieved March 27, 2016.
- Matthias Kretschmann. "HowTo: Make Ubuntu A Perfect Mac File Server And Time Machine Volume". Retrieved September 11, 2009.
- MKurtz. "NSLU2-Linux - HowTo / TimeMachineBackups". Retrieved September 11, 2009.
- harryd71. "Mac OS X Time Machine and FreeNAS 0.7". Retrieved January 17, 2010.
- QNAP Systems Inc. "Qnap-Apple time machine support". Retrieved August 18, 2012.
- Bastian Bechtold. "Using a Raspberry Pi as a Time Capsule for Mountain Lion". Retrieved August 23, 2012.
- Alonso, Noel. "Using Netatalk: AFP Services on a Linux Server". AFP548.com. Retrieved November 1, 2013. Also see slowfranklin's comment and its replies. To add the guest UAM, add
AFPD_UAMLIST="-U uams_guest.so"
to the[Global]
section inafp.conf
. - Bas van de Wiel. "Ironclad Time Machine backups on FreeBSD". Retrieved March 18, 2016.
- Pond, James (August 31, 2013). "How Time Machine Works its Magic". Apple OSX and Time Machine Tips. baligu.com. File System Event Store,Hard Links. Retrieved May 19, 2019.
- Caldwell, Serenity (February 21, 2012). "Ten exciting system changes in Mountain Lion". Mac-world. Retrieved April 29, 2012.
- Bobby, Brant. "macos - On OS X, what files are excluded by rule from a Time Machine backup?". Ask Different.
- "Feature Request: Honor com_apple_backup_excludeItem on MacOS · Issue #478 · gilbertchen/duplicacy". GitHub.
- "CSBackupSetItemExcluded - Core Services". Apple Developers Documentation.