我已经使用了以下Applescript多年来从Applescript中触发Time Machine。它似乎不再适用于Mac OS X 10.9 Mavericks。任何人都知道解决方案或替代方案。此脚本运行并且不会抛出任何错误消息。它什么都不做。
do shell script "/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper >/dev/null 2>&1 &"
答案 0 :(得分:5)
您可以在10.7及更高版本中使用tmutil:
do shell script "tmutil startbackup"
-b
阻止脚本,直到保存快照完成,因此您可以执行tmutil startbackup -b&&diskutil eject Time\ Machine
之类的操作。 -a
以类似于自动计划备份的模式执行备份。
startbackup [-a | --auto] [-b | --block] [-r | --rotation] [-d |
--destination dest_id]
Begin a backup if one is not already running.
Options:
--auto Run the backup in a mode similar to system-
scheduled backups.
--block Wait (block) until the backup is finished
before exiting.
--rotation Allow automatic destination rotation during
the backup.
--destination Perform the backup to the destination corre-
sponding to the specified ID.
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 system-scheduled backups, it provides custom schedulers the
ability to achieve some (but not all) behavior normally exhibited
when operating in automatic mode.