Scheduled Jobs with Launch Daemons-Agents and plist FilesSOFTWARE: mac os x/Library/LaunchDaemons Mac OS X Version: 10.4 + Launchd seems to have replaced cron on mac os x at this point. Here are tips on using launchctl to activate/deactivate existing jobs, and also how to create your own jobs. Load/Unload Existing DaemonsUse launchctl to add/remove startup items. Find full usage here: To load:
To unload:
Example with Macports Existing plist filesStartup items (at least for macports installs) are symlinks to .plist format files inside:
I've noticed that if you upgrade a macport --like mysql5 or apache2 for instance-- sometimes the startup item that kicks it off on boot up goes away. To fix this, look inside /Library/LaunchDaemons and find the names of the .plist files you have. I had these symlinks:
I added them back as startup items with these commands:
and
And now both apache and mysql get fired up on boot up again. Creating and Activating Your Own plist FilesFor timed jobs on the mac:
Contents for your plist file would be like this (see below) for a scheduled job called ???com.mydomain.sync.plist??? which runs the file ???myshellscript.sh??? at 9:00am every day (that the machine is powered on):
flush dns cacheSOFTWARE: mac os xlookupd -flushcache Mac OS X - Flush DNS Cache10.4
10.5
Linux
Windows
MORE INFO: http://www.tech-faq.com/flush-dns.shtmlSwitch Tabs in Terminal (10.5)SOFTWARE: mac os xCommand Key + Shift + Right/Left Arrows To switch between tabs in the terminal:
MORE INFO: create iso > burn discSOFTWARE: mac os xhdiutil makehybrid -o yournewiso_name /Path/To/Disc Mac OS X LeopardTo use the command line to copy a disc, first create an iso file from the disc, then after that finishes, insert a blank disc and burn the blank disc with the iso file you just made. You'll be using the hdiutil command in the terminal to do this. Create iso fileInsert your disc you want to copy. Change directory to where you want to create the new iso file. IE to change to your current user's Documents folder:
Then run hdiutil to make a "hybrid" iso that can run on different os's. After the -o flag designate the name of your iso file minus the .iso suffix, then designate the full path to the disc you've inserted. If the disc name include spaces, wrap it in quotes:
Example:
Burn to new discUse the burn command and simply designate the full path the the iso you created above. Assuming you just have one burner hooked up to your machine, you don't have to tell it which burner to use so it's just:
Example:
There are many additional options to hdiutil if you need them. You can find the full docs by typing this in your terminal:
MORE INFO: vmware fusion duplicate entriesSOFTWARE: mac os xmv "/Users/${USER}/Library/Preferences/com.vmware.fusion.plist" "/Users/${USER}/Library/Preferences/(...) To get rid of duplicate entries in the fusion library. Generate a fresh plist file so your vmware fusion library populates correctly after system/fusion upgrades:
MORE INFO: |