Changing the backup interval in Time Machine

Discussion in 'Apple' started by Michelle Steiner, Nov 3, 2007.

  1. Someone posted a tip on how to do it with terminal, editing the plist
    file; of course, any plist editor can do it as well.

    Or you can use this AppleScript. It lets you choose the time in hours
    or minutes, and it does the rest itself.

    The script does not do error checking for improper input in the dialog
    (i.e., non-numerical characters); if there is an input error, the script
    will halt with an error message.

    I tried to put enough soft returns "¬" to avoid line wrapping by the
    news editor, but be careful of inadvertent wrapping, especially in the
    middle of quoted text.

    set the DialogReturn to ¬
    (display dialog "Enter the backup interval you wish." default answer ¬
    "1" buttons {"Hours", "Minutes", "Cancel"} ¬
    default button "Hours" with title "Set Time Machine Backup Interval")
    set the RawNumber to ¬
    the text returned of the DialogReturn as number
    set the TimeUnit to the button returned of the DialogReturn
    if the TimeUnit is "Minutes" then
    set the BackupInterval to the RawNumber * minutes
    else if the TimeUnit is "Hours" then
    set the BackupInterval to the RawNumber * hours
    end if
    set the BackupInterval to the BackupInterval as integer

    set thePath to ((path to library folder from system domain) as text) & ¬
    "LaunchDaemons:com.apple.backupd-auto.plist"
    do shell script ¬
    "chmod a+w /System/Library/LaunchDaemons/com.apple.backupd-auto.plist"
    with administrator privileges
    tell application "System Events"
    tell property list file thePath
    set value of property list item "StartInterval" of it to ¬
    the BackupInterval
    end tell
    end tell
    do shell script ¬
    "chmod go-w /System/Library/LaunchDaemons/com.apple.backupd-auto.plist"
    with administrator privileges
     
    Michelle Steiner, Nov 3, 2007
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.