Tech Reflect

Tech Reflect

Share this post

Tech Reflect
Tech Reflect
Set up timed or recurring scripts

Set up timed or recurring scripts

Chris Hynes - cricket's avatar
Chris Hynes - cricket
Aug 14, 2017
∙ Paid

Share this post

Tech Reflect
Tech Reflect
Set up timed or recurring scripts
Share

It’s fairly straightforward to leverage launchd to run a script either at specified intervals or at specific times of the day. I find that most people only want to do fairly simple things, so I’ve kept this simple.

The way launchd works is that you create a plist, then run a command to either load or unload the plist. Here is an example plist that will run the script called “rsync-backup-work” every 3 hours. The first 3 lines are just boilerplate for a plist.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
     "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
          <string>org.cricket.rsync-backup-work</string
     <key>ProgramArguments</key>
          <array>
               <string>/Users/admin/bin/rsync-backup-work</string
          </array>
     <key>StartInterval</key>
          <integer>10800</integer>
</dict>
</plist>

This has only three keys:

  • Label → Unique identifier (this can just…

Keep reading with a 7-day free trial

Subscribe to Tech Reflect to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Christopher Hynes
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share