Jump to content

Recommended Posts

Posted

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

KeepAlive

Label

moodle4mac.cron

ProgramArguments

curl -s http://lcps_mac1.lcps.k12.va.us/moodle/admin/cron.php

RunAtLoad

StartInterval

60

 

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!

Posted

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.

Posted
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. :)

Posted

Modify to suit...

 




       Label
       com.the-website.cron
       ProgramArguments
       
               curl
               -s
               http://www.the-webwite.com/cron.php
       
       RunAtLoad
       
       StartInterval
       3600
               UserName
       www
       GroupName
       www

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...