<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>精東·博客 &#187; Cron Job</title>
	<atom:link href="http://www.wemvc.com/tag/cron-job/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wemvc.com</link>
	<description>男人的胸怀是委屈撑大的。</description>
	<lastBuildDate>Tue, 10 Jan 2012 04:26:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>magento &#8211; 计划任务（cron job）在magento中的作用和使用教程</title>
		<link>http://www.wemvc.com/1308.html</link>
		<comments>http://www.wemvc.com/1308.html#comments</comments>
		<pubDate>Fri, 25 Jun 2010 19:29:29 +0000</pubDate>
		<dc:creator>精东</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Cron Job]]></category>
		<category><![CDATA[Crontab]]></category>

		<guid isPermaLink="false">http://www.wemvc.com/?p=1308</guid>
		<description><![CDATA[      计划任务（cron job）是Magento系统中一个很有用甚至可以说必须使用的功能，而最近在网上跟人聊天发现很多Magento的使用者不知道这个功能或者知道却认为可有可无，我在这里建议各位Magento的使用者，把这个功能使用起来吧。
在之前关于Newsletter的那篇博文我有讲到，要使新闻能按设定的时间自动发送，就必须设置好计划任务（cron job）。计划任务（cron job）简单的来说就是在系统中每隔一段时间来重复操作一件事，比如每隔多少时间清理日志，比如每天提交Sitemap给google等等。

而要设置计划任务（cron job），需要在网站运行的服务器（以linux为例）写一段脚本来定时调用网站根目录下的cron.php文件。下面是我自己使用的服务器的设置方式：

crontab */5 * * * * /usr/bin/php -f /home/yourdomainname/public_html/cron.php

         当然，首先你的服务器得支持cron job你才能使用crontab 这个命令，设置完的效果是服务器每隔5分钟运行一次你的网站根目录下的cron.php文件，cron.php运行时会去检查计划任务时间表中哪些任务的预定时间已经到了，如果到了就立即执行预定的任务，比如提交sitemap，并同时根据各个任务的配置文件或预先设定的任务（特指newsletter）生成新的计划任务时间表。储存这些数据的是数据库中的cron_schedule表，进这个表你会看到一个计划任务的列表:
&#8220;>
要让某个功能按时运行需要在对应的config.xml中设置计划任务，指定要运行的某个类的某个方法，同样以google sitemap为例

 &#60;crontab&#62;
    &#60;jobs&#62;
        &#60;sitemap_generate&#62;
            [...]]]></description>
		<wfw:commentRss>http://www.wemvc.com/1308.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

