Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'If you don't want to run it from a crontab' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
If you don't want to run it from a crontab
Authored by: Ptitboul on Apr 15, '04 05:57:21AM
For example, if the computer you want to backup is a laptop, it might not be connected when the crontab runs. The solution I use is to make a backup each time there is a network change. First you have to change the file /System/Library/SystemConfiguration/Kicker.bundle/Contents/Resources/Kicker.xml to add the following lines

        <dict>
                <key>execCommand</key>
                <string>$BUNDLE/Contents/Resources/disk-backup</string>
                <key>execUID</key>
                <integer>0</integer>
                <key>keys</key>
                <array>
                        <string>State:/Network/Global/DNS</string>
                        <string>State:/Network/Global/IPv4</string>
                        <string>Setup:/</string>
                </array>
                <key>name</key>
                <string>disk-backup</string>
        </dict>
Then you have to create a file named /System/Library/SystemConfiguration/Kicker.bundle/Contents/Resources/disk-backup that will run the backup, e.g. something like

#! /bin/sh
case "`ifconfig|grep 'inet '`" in *' 64.233.'*)
  # run only if you have a fast connection
  logger -i -p daemon.notice -t disk-backup Backup of local disk data
  exec >> /var/log/disk-backup.log 2>&1
  /usr/local/bin/rsyncbackup (...)
;; esac
Note that with this example the rsyncbackup utility is run with administrator priviledges. Moreover, the Kicker.xml file can be changed by some system updates, therefore you have to check that your modification is still there after each system update.

[ Reply to This | # ]