<?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>深蓝的blog &#187; crontab</title>
	<atom:link href="http://www.lanxinbase.com/?feed=rss2&#038;tag=crontab" rel="self" type="application/rss+xml" />
	<link>http://www.lanxinbase.com</link>
	<description>记录日常生活</description>
	<lastBuildDate>Sat, 18 Apr 2026 07:10:07 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.3</generator>
	<item>
		<title>linux计划任务crontab例子</title>
		<link>http://www.lanxinbase.com/?p=1322</link>
		<comments>http://www.lanxinbase.com/?p=1322#comments</comments>
		<pubDate>Fri, 30 Sep 2016 06:16:23 +0000</pubDate>
		<dc:creator><![CDATA[Alan]]></dc:creator>
				<category><![CDATA[2.运维相关]]></category>
		<category><![CDATA[crontab]]></category>

		<guid isPermaLink="false">http://www.lanxinbase.com/?p=1322</guid>
		<description><![CDATA[/root/send_msg.sh #要自动执行的脚本程序路径

chmod +x /root/send_msg.sh #对脚本文件添加执行权限，否则不能执行

vim /etc/crontab #编辑配置文件，在最后一行添加内容

30 1 * * * root /root/send_msg.sh #表示每天凌晨1点30执行备份

:wq! #保存退出


service crond restart / service crond reload #重启/重载配置文件


crontab文件的格式：

minute hour day month weekday username command
minute：分，值为0-59
hour：小时，值为1-23
day：天，值为1-31
month：月，值为1-12
weekday：星期，值为0-6（0代表星期天，1代表星期一，以此类推）
username：要执行程序的用户，一般设置为root
command：要执行的程序路径（设置为绝对路径）例如：/root/send_msg.sh
附：crontab规则详细实例]]></description>
		<wfw:commentRss>http://www.lanxinbase.com/?feed=rss2&#038;p=1322</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
