Files
shell-scripting-templates/syncScripts
2015-01-02 23:10:33 -05:00
..
2015-01-02 20:55:03 -05:00
2015-01-02 20:55:03 -05:00

iPhotoUnison.sh

iTunesRsync.sh

This script was written to push the iTunes library on my MacMini named MiniMusic to my ReadyNAS for backup purposes.

It is run every day by a plist file that was loaded into Launchd. This file was loaded using a program call Lingon. If you don't have access to that program, here's manual instructions for loading/unloading launchd tasks.

Installing launchd tasks

First, create a plist XML document. You can find information on these

this document should be named something like com.mycompanyname.mydepartment.mytaskname.plist

Second, copy the plist files into your LaunchDaemons folder (or LaunchAgents, if you want it to only run when youre logged in):

cp com.mycompanyname.mydepartment.mytaskname.plist /Library/LaunchDaemons

Third, so that launchd will pick it up without needing a reboot, we do the following:

launchctl load -w /Library/LaunchDaemons/com.mycompanyname.mydepartment.mytaskname.plist

To check its all installed, do launchctl list and check that your task is in the list.

Disabling launchd tasks

When the time comes that you need to disable the task, do the following:

launchctl unload -w /Library/LaunchDaemons/com.mycompanyname.mydepartment.mytaskname.plist rm /Library/LaunchDaemons/com.mycompanyname.mydepartment.mytaskname.plist