---
updatedAt: 2025-08-14T13:35:32.000Z
agentTools:
  siteIndex: https://developer.n-able.com/llms.txt
  projectIndex: https://developer.n-able.com/n-central/llms.txt
---

# Mac - Time Machine Backup Status

```shell Shell Script(.sh)
#!/bin/sh

# If your Mac uses Time Machine to perform backups, this will tell you if the backup
# process is idle or working, and if it's working, the percentage completed.


if [ "$(defaults read /Library/Preferences/com.apple.TimeMachine AutoBackup)" -eq 0 ] 
then
	echo "Time Machine backups are disabled."
	exit 1
fi

currentPhase="$(tmutil currentphase)"

case "$currentPhase" in

	BackupNotRunning)
		echo "Time Machine is idle."
		exit 0
	;;

	MountingBackupVol | MountingBackupVolForHealthCheck | DeletingOldBackups | ThinningPreBackup | Starting)
		echo "Time Machine is starting."
		exit 0
	;;

	Copying)
		echo "Time Machine is copying files to backup."
	;;

	Finishing | ThinningPostBackup)
		echo "Time Machine is finishing the backup process."
		exit 0
	;;

	HealthCheckCopyHFSMeta | HealthCheckFsck) 
		echo "Time Machine is verifying and checking your backups."
		exit 0
	;;

	*)
		echo "An unknown error ocurred."
		echo "tmutil returned:"
		echo "$currentPhase"
		exit 1
	;;
esac

# get status, look for "Percent=" line, strip anything non numerical or decimal point, truncate at decimal.
percentComplete="$(tmutil status | grep -m1 Percent | tr -cd '0-9.' | cut -f1 -d '.')"

# if empty, percent = 0
[ "$percentComplete" ] || percentComplete=0


echo "Percent Completed: $percentComplete%"
```

```json Response Example
{"success":true}
```

# SCRIPT