Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Scheduling Timed Jobs

Since cron is no longer supported on MacOS you have to use the provided Launch Agent instead launchd.

This is done by adding configuration file in plist format (XML) to a directory in your library structure, e.g. ~/Library/LaunchAgents/.

The following example updates my local CPAN::Mini mirror every day at 12:00 AM.

Filename: com.jonasbn.minicpan.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
<plist version="1.0">

Sleep and Power

All launchd jobs are skipped when the computer is turned off or asleep; they will not run until the next designated time occurs, if the computer is turned on or not asleep.