Programmatically check if TM's local backups are enabled?

Is there a way to programmatically check if Time Machine's "local snapshots" feature is turned on or off on the current Mac?

Preferrably, the API should work in sandboxed mode too.

(By default this setting is ON on Macbooks and OFF on iMacs, toggled globally by "sudo tmutil enablelocal" and "sudo tmutil disablelocal" Terminal commands. The feature creates temporary (purgeable) backups in /.MobileBackups folder which are later synced with permanent backaup storage such as Time Capsule.)


Thanks!

Replies

Hello Sheldon15,

You can check the "MobileBackups" key in /Library/Preferences/com.apple.TimeMachine.plist. It is only going to be reliable on 10.8 or later. It is not accessible from the sandbox.

Thanks. Is it documented anywhere?