+ Post New Thread
Results 1 to 4 of 4
Mac Thread, help with launchd / cron replacement - Moodle OSX install in Technical; Hey all, I'm working with Moodle (moodle.org) and trying to load it on an OS X server with specs below: ...
  1. #1

    Join Date
    Jun 2008
    Posts
    105
    Thank Post
    33
    Thanked 3 Times in 3 Posts
    Rep Power
    13

    Question help with launchd / cron replacement - Moodle OSX install

    Hey all,

    I'm working with Moodle (moodle.org) and trying to load it on an OS X server with specs below:
    Moodle 1.9.8+ (Build: 20100526)
    Mac server OS X 10.5.8

    Moodle requires a cron job to run every 5 minutes to update forums, send out emails, etc - basically proper functioning of the site. However, this version of OS X uses launchd rather than cron for cron jobs, and I can't get it working per Moodle's documentation. Here's the error I get in the system.log:

    May 31 13:28:20 lcps_mac1 com.apple.launchd[1] (moodle4mac.cron[2450]): posix_spawnp("curl -s http://lcps_mac1.lcps.k12.va.us/moodle/admin/cron.php", ...): No such file or directory
    May 31 13:28:20 lcps_mac1 com.apple.launchd[1] (moodle4mac.cron[2450]): Exited with exit code: 1

    As you can see, I'm trying to use curl to open the cron.php page from our Moodle site, which will run the board updates, etc. Running it manually from the command line with curl works fine.

    Here's my plist file:
    lcps_mac1:LaunchDaemons admin$ cat /Library/LaunchDaemons/moodle4mac.cron.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>
    <false/>
    <key>Label</key>
    <string>moodle4mac.cron</string>
    <key>ProgramArguments</key>
    <array>
    <string>curl -s http://lcps_mac1.lcps.k12.va.us/moodle/admin/cron.php</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>StartInterval</key>
    <integer>60</integer>
    </dict>
    </plist>

    I've tried editing the file by hand as well as installing Lingon, to no avail. Here are the permissions on the plist file:
    -rw-r--r-- 1 root wheel 481 May 31 13:27 moodle4mac.cron.plist

    And finally, here's the Moodle info on doing this:
    Cron - MoodleDocs

    I'm stuck, but I feel it's something basic with launchd that I'm doing wrong. I've tried posting my issue on the Moodle boards, but haven't gotten any help. So I'm hoping my other tech friends can shed some light on the issue.

    I've been given the suggestion to wipe the OS X box and load Ubuntu - if my boss would go for it I'd do it in a heartbeat But to no avail...

    Regardless, thanks!

  2. #2

    Join Date
    May 2006
    Location
    West Bromwich
    Posts
    2,192
    Thank Post
    300
    Thanked 215 Times in 185 Posts
    Rep Power
    57
    Is the curl -s wrapped or is that a carriage return? If a carriage return then would that cause an issue?

    Other than that I'm not sure. Maybe you could try the crontab command on the command line.

  3. #3

    Join Date
    Jun 2008
    Posts
    105
    Thank Post
    33
    Thanked 3 Times in 3 Posts
    Rep Power
    13
    Quote Originally Posted by HodgeHi View Post
    Is the curl -s wrapped or is that a carriage return? If a carriage return then would that cause an issue?

    Other than that I'm not sure. Maybe you could try the crontab command on the command line.
    It's a wrap unfortunately. I'll try the crontab command you suggest - thanks.

  4. #4

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,812
    Thank Post
    110
    Thanked 585 Times in 506 Posts
    Blog Entries
    1
    Rep Power
    224
    Modify to suit...

    Code:
    <?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.the-website.cron</string>
            <key>ProgramArguments</key>
            <array>
                    <string>curl</string>
                    <string>-s</string>
                    <string>http://www.the-webwite.com/cron.php</string>
            </array>
            <key>RunAtLoad</key>
            <true/>
            <key>StartInterval</key>
            <integer>3600</integer>
                    <key>UserName</key>
            <string>www</string>
            <key>GroupName</key>
            <string>www</string>
    </dict>
    </plist>

SHARE:
+ Post New Thread

Similar Threads

  1. OSX on PC?
    By Ben-BSH in forum Mac
    Replies: 11
    Last Post: 10th February 2010, 03:11 PM
  2. Cron (Moodle/ Corn.php) on Ubuntu 8.04lts
    By kieran8055 in forum Virtual Learning Platforms
    Replies: 7
    Last Post: 18th September 2009, 03:41 PM
  3. Can't make cron work
    By powdarrmonkey in forum *nix
    Replies: 8
    Last Post: 26th August 2008, 09:44 PM
  4. Replies: 5
    Last Post: 7th December 2007, 02:36 PM
  5. Powerbook g4 TO osx
    By thegrassisgreener in forum Mac
    Replies: 1
    Last Post: 13th October 2007, 08:22 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •