If you run a website with Drupal content, you understand the need to run cron periodically (http://yoursitename/cron.php). Some hosting companies won't allow cron jobs on their servers, leaving you in a bind. If you have a Mac sitting around that's awake at a certain time every day, just have it and its built-in scheduling system, launchd, do the job for you.
<?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>com.darla.cron</string> <key>ProgramArguments</key> <array> <string>/usr/bin/curl</string> <string>--connect-timeout</string> <string>10</string> <string>http://www.someurl.com/cron.php</string> </array> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>8</integer> <key>Minute</key> <integer>0</integer> </dict> </dict> </plist> <string>com.darla.cron</string><string>http://www.someurl.com/cron.php</string> <dict> <key>Hour</key> <integer>8</integer> <key>Minute</key> <integer>0</integer> </dict>launchctl loadWhat does the above plist do? It invokes the Mac's scheduling system, launchd, at a specified time, and tells it to access a certain URL (link) via the curl command. That's all. Drupal has a built-in web page, cron.php, which performs certain maintenance tasks for your Drupal site. You could access the URL manually yourself once a day (or several times a day, depending on how active a site you maintain), but automation is so much more geeky.
Recent comments
13 weeks 2 days ago
14 weeks 4 days ago