Time Machine (macOS)

Last updated

Time Machine
Developer(s) Apple Inc.
Operating system macOS 10.5 or newer
Type Backup software
License Proprietary
Website support.apple.com/en-us/HT201250

Time Machine is the backup mechanism of macOS, the desktop operating system developed by Apple. The software is designed to work with both local storage devices and network-attached disks, and is most commonly used with external disk drives connected using either USB or Thunderbolt. It was first introduced in Mac OS X 10.5 Leopard, which appeared in October 2007 and incrementally refined in subsequent releases of macOS. Time Machine was revamped in macOS 11 Big Sur to support APFS, thereby enabling "faster, more compact, and more reliable backups" than were possible previously. [1] [2]

Contents

Overview

Time Machine creates incremental backups of files that can be restored at a later date. [3] It allows the user to restore the whole system or specific files. It also works within a number of applications such as Mail and iWork, making it possible to restore individual objects (e.g. emails, contacts, text documents, presentations) 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.” [4]

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) or a recent version of the Server Message Block (SMB) protocol, and Time Machine no longer works with servers using earlier versions of SMB. [5] Some of the legacy support can be re-enabled by using hand-tuned configuration options, accessed through the Terminal. Apple's Time Capsule, which was introduced in 2008 and discontinued in 2018, acted 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 other external or internal volumes.

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. [6]

Revamp in macOS Big Sur

Time Machine was overhauled in macOS 11 Big Sur to utilize APFS, Apple's modern file system first introduced in 2016. Specifically, the new version of Time Machine makes use of APFS's snapshot technology. [1] [7] [8] According to Apple, this enables "faster, more compact, and more reliable backups" than were possible previously with HFS+-formatted drives. [1] [2] An independent evaluation of this claim found that macOS 11's Time Machine implementation in conjunction with APFS was 2.75-fold faster upon initial local backup and 4-fold faster upon subsequent backups relative to macOS 10.15's Time Machine implementation using HFS+. [2] A more modest yet nevertheless significant advantage was noted as well for backups to network-attached disks. [2]

New local (i.e. USB- or Thunderbolt-connected) and network-connected Time Machine backup destinations are formatted as APFS by default, though Time Machine can continue backing up to existing HFS+ backup volumes." [1] There is no option to convert existing, HFS+-based backups to APFS; instead, users who want to benefit from the advantages of the new, APFS-based implementation of Time Machine need to start with a fresh volume. [2]

At least in some circumstances, encryption appears to be required (instead of merely optional) in the new version of Time Machine. [2]

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 currently deleted data) may be retrieved.

Storage

Time Machine works with locally connected storage disks, which must be formatted in the APFS or HFS+ volume formats. Support for backing up to APFS volumes was added with macOS 11 Big Sur and since then APFS is the default volume format.

Time Machine also works 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: [9]

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 also configured FreeBSD and Linux servers and network-attached storage systems to serve Time Machine-enabled Macs. There are also a few software tools available on the market that can copy files inside Time Machine backups in Windows machines. [10] [11] [12] [13] [14] [15] [16] [17]

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 storage 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 (in the case of HFS+ volumes) 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. [18]

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; Time Machine presents each backup to the user as a complete disk copy. [18]

Time Machine on HFS+ volumes creates multiple hard links to unmodified directories. [18] Multiple linking of directories is a peculiar feature for HFS+, and is not supported on modern Unix file systems including Apple's own APFS. [19] 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. 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 macOS installation process. One of the features in the Migration Assistant interface is to restore 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. [20]

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. [21]

Google Chrome is known to use the attribute to exclude its histories. [21] Third-party backup applications that respect this setting include CrashPlan and Arq. [22] Apple wraps the attribute into the tmutil command-line utility [21] as well as a CoreServices API. [23]

See also

Related Research Articles

New Technology File System (NTFS) is a proprietary journaling file system developed by Microsoft. Starting with Windows NT 3.1, it is the default file system of the Windows NT family. It superseded File Allocation Table (FAT) as the preferred filesystem on Windows and is supported in Linux and BSD as well. NTFS reading and writing support is provided using a free and open-source kernel implementation known as NTFS3 in Linux and the NTFS-3G driver in BSD. By using the convert command, Windows can convert FAT32/16/12 into NTFS without the need to rewrite all files. NTFS uses several files typically hidden from the user to store metadata about other files stored on the drive which can help improve speed and performance when reading data. Unlike FAT and High Performance File System (HPFS), NTFS supports access control lists (ACLs), filesystem encryption, transparent compression, sparse files and file system journaling. NTFS also supports shadow copy to allow backups of a system while it is running, but the functionality of the shadow copies varies between different versions of Windows.

Hierarchical File System (HFS) is a proprietary file system developed by Apple Inc. for use in computer systems running Mac OS. Originally designed for use on floppy and hard disks, it can also be found on read-only media such as CD-ROMs. HFS is also referred to as Mac OS Standard, while its successor, HFS Plus, is also called Mac OS Extended.

<span class="mw-page-title-main">AirPort</span> Discontinued line of products by Apple Inc.

AirPort is a discontinued line of wireless routers and network cards developed by Apple Inc. using Wi-Fi protocols. In Japan, the line of products was marketed under the brand AirMac due to previous registration by I-O Data.

The resource fork is a fork or section of a file on Apple's classic Mac OS operating system, which was also carried over to the modern macOS for compatibility, used to store structured data along with the unstructured data stored within the data fork.

FileVault is a disk encryption program in Mac OS X 10.3 (2003) and later. It performs on-the-fly encryption with volumes on Mac computers.

<span class="mw-page-title-main">Multi-booting</span> Act of installing multiple operating systems on a single computer

Multi-booting is the act of installing multiple operating systems on a single computer, and being able to choose which one to boot. The term dual-booting refers to the common configuration of specifically two operating systems. Multi-booting may require a custom boot loader.

The Apple Filing Protocol (AFP), formerly AppleTalk Filing Protocol, is a proprietary network protocol, and part of the Apple File Service (AFS), that offers file services for macOS, classic Mac OS, and Apple IIs. In OS X 10.8 Mountain Lion and earlier, AFP was the primary protocol for file services. Starting with OS X 10.9 Mavericks, Server Message Block (SMB) was made the primary file sharing protocol, with the ability to run an AFP server removed later in macOS 11 Big Sur. The latest version of Apple's OS at the time of writing, macOS Ventura, is still able to authenticate with and connect to AFP servers. AFP supports Unicode file names, POSIX and access control list permissions, resource forks, named extended attributes, and advanced file locking.

Macintosh File System (MFS) is a volume format created by Apple Computer for storing files on 400K floppy disks. MFS was introduced with the original Apple Macintosh computer in January 1984.

HFS Plus or HFS+ is a journaling file system developed by Apple Inc. It replaced the Hierarchical File System (HFS) as the primary file system of Apple computers with the 1998 release of Mac OS 8.1. HFS+ continued as the primary Mac OS X file system until it was itself replaced with the Apple File System (APFS), released with macOS High Sierra in 2017. HFS+ is also one of the formats supported by the iPod digital music player.

<span class="mw-page-title-main">File system</span> Format or program for storing files and directories

In computing, a file system or filesystem is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one large body of data with no way to tell where one piece of data stopped and the next began, or where any piece of data was located when it was time to retrieve it. By separating the data into pieces and giving each piece a name, the data are easily isolated and identified. Taking its name from the way a paper-based data management system is named, each group of data is called a "file". The structure and logic rules used to manage the groups of data and their names is called a "file system."

In a computer file system, a fork is a set of data associated with a file-system object. File systems without forks only allow a single set of data for the contents, while file systems with forks allow multiple such contents. Every non-empty file must have at least one fork, often of default type, and depending on the file system, a file may have one or more other associated forks, which in turn may contain primary data integral to the file, or just metadata.

A versioning file system is any computer file system which allows a computer file to exist in several versions at the same time. Thus it is a form of revision control. Most common versioning file systems keep a number of old copies of the file. Some limit the number of changes per minute or per hour to avoid storing large numbers of trivial changes. Others instead take periodic snapshots whose contents can be accessed with similar semantics to normal file access.

The following tables compare general and technical information for a number of file systems.

A sparse image is a type of disk image file used on macOS that grows in size as the user adds data to the image, taking up only as much disk space as stored in it. Encrypted sparse image files are used to secure a user's home directory by the FileVault feature in Mac OS X Snow Leopard and earlier. Sparse images can be created using Disk Utility.

<span class="mw-page-title-main">AirPort Time Capsule</span> Wireless router by Apple

The AirPort Time Capsule is a wireless router which was sold by Apple Inc., featuring network-attached storage (NAS) and a residential gateway router, and is one of Apple's AirPort products. They are, essentially, versions of the AirPort Extreme with an internal hard drive. Apple describes it as a "Backup Appliance", designed to work in tandem with the Time Machine backup software utility introduced in Mac OS X 10.5.

<span class="mw-page-title-main">Apple Disk Image</span> Disk image file format developed by Apple and commonly used by macOS

AppleDisk Image is a disk image format commonly used by the macOS operating system. When opened, an Apple Disk Image is mounted as a volume within the Finder.

Apple File System (APFS) is a proprietary file system developed and deployed by Apple Inc. for macOS Sierra (10.12.4) and later, iOS 10.3 and later, tvOS 10.2 and later, watchOS 3.2 and later, and all versions of iPadOS. It aims to fix core problems of HFS+, APFS's predecessor on these operating systems. APFS is optimized for solid-state drive storage and supports encryption, snapshots, and increased data integrity, among other capabilities.

macOS Big Sur 17th major version of the macOS operating system

macOS Big Sur is the seventeenth major release of macOS, Apple Inc.'s operating system for Macintosh computers. It was announced at Apple's Worldwide Developers Conference (WWDC) on June 22, 2020, and was released to the public on November 12, 2020.

<span class="mw-page-title-main">Carbon Copy Cloner</span> Backup software

Carbon Copy Cloner is a backup and disk cloning utility for macOS made by Bombich.

References

  1. 1 2 3 4 "macOS Big Sur 11.0.1 Release Notes". Apple. Retrieved December 13, 2020.
  2. 1 2 3 4 5 6 Cunningham, Andrew (November 12, 2022). "macOS 11.0 Big Sur: The Ars Technica review". Ars Technica. Retrieved March 6, 2021.
  3. Apple. "Apple - Mac OS X Leopard - Features - Time Machine" . Retrieved December 21, 2007.
  4. "Time Machine keeps saying not enough space | Communities". discussions.apple.com. Retrieved October 21, 2017.
  5. 1 2 "Time Machine over SMB Specification". Documentation Archive. Apple Inc. September 13, 2016. Retrieved April 24, 2019.
  6. Tiwari, Saurabh (May 7, 2018). "Create a backup with Time Machine on Mac". Techi Bhai. Retrieved February 16, 2022.
  7. Owen, Malcolm (June 27, 2020). "APFS changes affect Time Machine in macOS Big Sur, encrypted drives in iOS 14". Apple Insider. Retrieved August 6, 2020.
  8. Oakley, Howard (June 20, 2020). "APFS changes in Big Sur: how Time Machine backs up to APFS, and more". The Eclectic Light Company. Retrieved August 6, 2020.
  9. "Backup disks you can use with Time Machine". Apple Support. Apple Inc. Retrieved November 30, 2020.
  10. Matthias Kretschmann. "HowTo: Make Ubuntu A Perfect Mac File Server And Time Machine Volume" . Retrieved September 11, 2009.
  11. MKurtz. "NSLU2-Linux - HowTo / TimeMachineBackups" . Retrieved September 11, 2009.
  12. harryd71 (November 23, 2009). "Mac OS X Time Machine and FreeNAS 0.7" . Retrieved January 17, 2010.
  13. QNAP Systems Inc. "QNAP NAS support for Apple Time Machine" . Retrieved November 30, 2020.
  14. Bastian Bechtold. "Using a Raspberry Pi as a Time Capsule for Mountain Lion" . Retrieved August 23, 2012.
  15. 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 in afp.conf.
  16. Bas van de Wiel. "Ironclad Time Machine backups on FreeBSD" . Retrieved March 18, 2016.
  17. Amar Ilindra (November 21, 2018). "How to Access and Restore Time Machine Backup Files on Windows".
  18. 1 2 3 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.
  19. Butts, Jeff (September 25, 2017). "Time Machine and APFS: What You Need to Know". The Mac Observer. Retrieved April 23, 2019.
  20. Caldwell, Serenity (February 21, 2012). "Ten exciting system changes in Mountain Lion". Mac-world. Retrieved April 29, 2012.
  21. 1 2 3 Bobby, Brant. "macos - On OS X, what files are excluded by rule from a Time Machine backup?". Ask Different.
  22. "Feature Request: Honor com_apple_backup_excludeItem on MacOS · Issue #478 · gilbertchen/duplicacy". GitHub.
  23. "CSBackupSetItemExcluded - Core Services". Apple Developers Documentation.