<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Cron_with_MAC_OS_X</id>
	<title>Cron with MAC OS X - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Cron_with_MAC_OS_X"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Cron_with_MAC_OS_X&amp;action=history"/>
	<updated>2026-05-06T19:50:43Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Cron_with_MAC_OS_X&amp;diff=3147&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Cron_with_MAC_OS_X&amp;diff=3147&amp;oldid=prev"/>
		<updated>2024-10-18T06:37:27Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 06:37, 18 октября 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Олег Давидович</name></author>
	</entry>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Cron_with_MAC_OS_X&amp;diff=3146&amp;oldid=prev</id>
		<title>1&gt;Tim@horizoneducationnetwork.org: clean up, typos fixed: ie: → i.e.:, automaticly → automatically</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Cron_with_MAC_OS_X&amp;diff=3146&amp;oldid=prev"/>
		<updated>2024-01-11T15:44:15Z</updated>

		<summary type="html">&lt;p&gt;clean up, typos fixed: ie: → i.e.:, automaticly → automatically&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE: This describes setting up Moodle&amp;#039;s cron using OSX&amp;#039;s launchd system. However, since OSX is a variant of Unix, cron is also an option. It should be noted, however, that OSX cron is actually managed by launchd.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following information was originally publish by Ralf Krause in the [[Step by Step Installation on a Mac OS X Server]].&lt;br /&gt;
&lt;br /&gt;
==launchd==&lt;br /&gt;
&lt;br /&gt;
In Mac OS X 10.5+ you will find the system daemon &amp;#039;&amp;#039;launchd&amp;#039;&amp;#039; for this service. This daemon offers a standardized interface to any user and all programs started automatically by the system. Please look at http://developer.apple.com/macosx/launchd.html for more informations about the configurations and all parameters. &lt;br /&gt;
&lt;br /&gt;
The service should get the web page http://path.to.your/moodle/admin/cron.php every few minutes. The configuration will be done by the file named &amp;#039;&amp;#039;moodle4mac.cron.plist&amp;#039;&amp;#039; which must be placed in the system folder &amp;#039;&amp;#039;/Library/LaunchDaemons/&amp;#039;&amp;#039; ... surely you can use any other file name but it should say something about the function of the service. The extension must be &amp;#039;&amp;#039;.plist&amp;#039;&amp;#039;. After any reboot of your Mac server the cron service will start automatically because the file is placed in the correct system folder.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039; Check the [[Cron settings]] to make sure running the web version of Moodle&amp;#039;s cron is permitted.&lt;br /&gt;
&lt;br /&gt;
===Use the graphical way===&lt;br /&gt;
You can use Lingon (no longer supported, unfortunately) to add a new daemon plist or to edit one. It produces the same text as you can write in your text editor. http://sourceforge.net/projects/lingon/files/&lt;br /&gt;
&lt;br /&gt;
[[Image:macosx-lingon.png|thumb|center|Lingon screenshot]]&lt;br /&gt;
&lt;br /&gt;
===Use a text editor===&lt;br /&gt;
Please use a text editor to write the needed file. You can open the Terminal and use the system editors vi or pico. But you can also write the text file with any GUI text editor ... I mostly use TextWrangler ... but do NOT take an editor for formatted texts like Microsoft Word or OpenOffice Writer. You must get pure text!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple Computer//DTD PLIST 1.0//EN&amp;quot; &lt;br /&gt;
      &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;KeepAlive&amp;lt;/key&amp;gt;&amp;lt;false/&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;Label&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;moodle4mac.cron&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;ProgramArguments&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
      &amp;lt;string&amp;gt;curl&amp;lt;/string&amp;gt;&lt;br /&gt;
      &amp;lt;string&amp;gt;-s&amp;lt;/string&amp;gt;&lt;br /&gt;
      &amp;lt;string&amp;gt;http://your-server-address/moodle19/admin/cron.php&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;RunAtLoad&amp;lt;/key&amp;gt;&amp;lt;true /&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;StartInterval&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;300&amp;lt;/integer&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;StandardErrorPath&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;/dev/null&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;StandardOutPath&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;/dev/null&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
 &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The label string must be the same as the file name is but without the extension &amp;#039;&amp;#039;.plist&amp;#039;&amp;#039;. Save the text file &amp;#039;&amp;#039;/Library/LaunchDaemons/moodle4mac.cron.plist&amp;#039;&amp;#039;. The owner of the file must be set to the system user &amp;#039;&amp;#039;root&amp;#039;&amp;#039; with the following:&lt;br /&gt;
&lt;br /&gt;
 sudo chown root /Library/LaunchDaemons/moodle4mac.cron.plist&lt;br /&gt;
&lt;br /&gt;
If you use a site with SSL (i.e.: it has an http&amp;#039;&amp;#039;&amp;#039;s&amp;#039;&amp;#039;&amp;#039;:// protocol) you either need to have your SSL certificates listed for use by the CURL utility ([http://curl.haxx.se/docs/sslcerts.html see these docs] for more details) OR you must use the &amp;#039;-k&amp;#039; switch in addition to the &amp;#039;-s&amp;#039; switch used above; your arguments line would then read: `&amp;lt;string&amp;gt;-s -k&amp;lt;/string&amp;gt;`.&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s all, really!&lt;br /&gt;
&lt;br /&gt;
===How to start and stop the cron service===&lt;br /&gt;
You can start the new cron service in the Terminal.&lt;br /&gt;
&lt;br /&gt;
 sudo launchctl load /Library/LaunchDaemons/moodle4mac.cron.plist&lt;br /&gt;
&lt;br /&gt;
The following command would stop the service. If you want to activate changes in the cron service you need to &amp;#039;&amp;#039;unload&amp;#039;&amp;#039; and then to &amp;#039;&amp;#039;load&amp;#039;&amp;#039; the daemon again.&lt;br /&gt;
&lt;br /&gt;
 sudo launchctl unload /Library/LaunchDaemons/moodle4mac.cron.plist&lt;br /&gt;
&lt;br /&gt;
===Only one service for two servers?===&lt;br /&gt;
For my server I needed to have a cron service for to instances &amp;#039;&amp;#039;moodle19&amp;#039;&amp;#039; and &amp;#039;&amp;#039;moodle20&amp;#039;&amp;#039; ... no problem ... with the typo &amp;#039;&amp;#039;moodle[19-20]&amp;#039;&amp;#039; I will get a cron service for both.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;curl -s http://your-server-address/moodle[19-20]/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if the cron service works correctly you should look at the &amp;#039;&amp;#039;access.log&amp;#039;&amp;#039; of your web server. The cron.php should be accessed every 5 minutes ... on my server for both Moodle instances &amp;#039;&amp;#039;moodle19&amp;#039;&amp;#039; and &amp;#039;&amp;#039;moodle20&amp;#039;&amp;#039; ... oh yes, it works!!&lt;br /&gt;
&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:10:56 +0200] &amp;quot;GET /moodle19/admin/cron.php HTTP/1.1&amp;quot; 200 1136&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:10:57 +0200] &amp;quot;GET /moodle20/admin/cron.php HTTP/1.1&amp;quot; 200 1403&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:11:18 +0200] &amp;quot;OPTIONS * HTTP/1.0&amp;quot; 200 -&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:15:56 +0200] &amp;quot;GET /moodle19/admin/cron.php HTTP/1.1&amp;quot; 200 735&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:15:57 +0200] &amp;quot;GET /moodle20/admin/cron.php HTTP/1.1&amp;quot; 200 964&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:20:56 +0200] &amp;quot;GET /moodle19/admin/cron.php HTTP/1.1&amp;quot; 200 1136&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:20:57 +0200] &amp;quot;GET /moodle20/admin/cron.php HTTP/1.1&amp;quot; 200 1365&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:Cron con MAC OS X]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Mac OS X]]&lt;/div&gt;</summary>
		<author><name>1&gt;Tim@horizoneducationnetwork.org</name></author>
	</entry>
</feed>