Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
osx:launchd [2015-11-10] – created dcaiosx:launchd [2020-04-19] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== OSX Launchd ======
  
 +==== Run every hour ====
 +
 +<code xml>
 +
 +<?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.dongsheng.crontask1</string>
 +    <key>ProgramArguments</key>
 +    <array>
 +        <string>/usr/bin/app</string>
 +        <string>-f</string>
 +        <string>/etc/app.ini</string>
 +    </array>
 +    <key>StartInterval</key>
 +    <integer>3600</integer><!-- seconds -->
 +</dict>
 +</plist>
 +
 +</code>
 +
 +
 +<code xml>
 +
 +<!-- StartCalendarInterval examples -->
 +
 +    <!-- Run every Sunday (weekday 0) at 15:30/3:30PM -->
 +    <key>StartCalendarInterval</key>
 +    <dict>
 +          <key>Weekday</key>
 +          <integer>0</integer>
 +          <key>Hour</key>
 +          <integer>15</integer>
 +          <key>Minute</key>
 +          <integer>30</integer>
 +    </dict>
 +
 +    <!-- You can use an array of dicts to specify multiple intervals -->
 +    <!-- Run at the beginning and middle of every hour, every day -->
 +    <key>StartCalendarInterval</key>
 +    <array>
 +        <dict>
 +            <key>Minute</key>
 +            <integer>0</integer>
 +        </dict>
 +        <dict>
 +            <key>Minute</key>
 +            <integer>30</integer>
 +        </dict>
 +    </array>
 +
 +</code>