Applescript在Mac OS X 10.9 Mavericks中触发Time Machine

时间:2013-11-23 16:37:35

标签: operating-system applescript osx-mavericks timemachine

我已经使用了以下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 &"

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.