On my Linux box I got cron task that runs script that uses sitecopy to upload new images to stock agencies every night. Cron is available on Mac but OS X is was deprecated and recommended method is launchd daemon.
My cron task runs shell script on weekdays:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (- installed on Tue Feb 3 19:39:38 2009)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
0 3 * * 0,1,2,3,4,5 /home/mordor/bin/autostock.sh
I am newbie on Mac so I searched for GUI interface to launchd. I found information about
lingon on Apple
Downloads.
It helped me to create my first 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>KeepAlive</key>
<true/>
<key>Label</key>
<string>net.melastmohican.autostock</string>
<key>ProgramArguments</key>
<array>
<string>/Users/mordor/bin/autostock.sh</string>
</array>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>0</integer>
<key>Weekday</key>
<integer>1</integer>
</dict>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>0</integer>
<key>Weekday</key>
<integer>2</integer>
</dict>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>0</integer>
<key>Weekday</key>
<integer>3</integer>
</dict>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>0</integer>
<key>Weekday</key>
<integer>4</integer>
</dict>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>0</integer>
<key>Weekday</key>
<integer>5</integer>
</dict>
</array>
</dict>
</plist>