⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0430cron.htm

📁 鸟哥的linux私房菜
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	>
<html lang="zh-TW">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
	<meta name="Author" content="VBird, 鸟哥" >
	<meta name="Description" content="包括了 crontab 与 at 这两支程式啦!" >
	<title>鸟哥的 Linux 私房菜 -- 例行性命令的建立</title>
	<style type="text/css">
	 	body {
			background-color: #D3D3D3;
			color: #000000;
			background-attachment:fixed ;
		}
				body,th,td,input,select,textarea,select,checkbox {
			font-family: '新细明体', 'Times New Roman', serif;
			font-size: 11pt ;
		}
		a:link		{text-decoration: none; color: blue}
		a:visited	{text-decoration: none; color: blue}
		a:active	{text-decoration: none; color: blue}
		a:hover		{text-decoration: underline; color: #ff0000}
				table.head1	{width:100%; background-color: #FFCCCC; 
				 border-style:groove;border-width:5px;border-color: #FFCCCC; margin:0;
				 padding: 5px 5px}
		   		   td.head1	{font: 10pt "新细明体", serif; color: #000099; }
		   		   td.info1	{font: 11pt "新细明体", serif; color: #000066; text-align:center; width:14%}
		   td.info2	{font: 11pt "新细明体", serif; color: #000066; text-align:center; width:12%}
		    *.info21	{font: 11pt "新细明体", serif; color: #000066; }
		    *.info22	{font: 11pt "新细明体", serif; color: blue  ; }
		    *.info23	{font: 11pt "新细明体", serif; color: green ; }
		   td.info3	{font: 11pt "新细明体", serif; color: #000066; text-align:justify}
				*.text_head0	{font-size:18pt; font-family:'标楷体','Times New Roman','Times', serif; }
		*.text_head_en	{font-size:18pt; font-family:'Times New Roman','Times', serif; }
				*.text_h1	{font: 15pt "新细明体", serif; color: #0000BB; font-weight: bold }
				*.text_h2	{font: 13pt "新细明体", serif; color: #0000BB; font-weight: bold }
				*.text_import1	{font:  11pt "新细明体", serif; color: #000088; font-weight: bold  }
		*.text_import2	{font:  11pt "新细明体", serif; color: #000088; font-weight: normal}
		*.text_vbird	{font:  11pt "新细明体", serif; color: #000088; font-weight: normal; 
				 font-style: italic;}
		*.text_history	{font:  10pt "新细明体", serif; color: #000066; }
		*.text_date	{font:  10pt "新细明体", serif; color: #3333FF; }
				*.block1	{padding: 10px 20px 10px 25px; text-align:left }
				*.block2	{padding: 10px 0px  10px 25px; text-align:left }
	    table.term2		{width: 350px; background-color: #000000;
				 border-style:groove;border-width:3px;border-color: #FFCCCC; margin:10px 0px;}
	    	    table.term		{width: 580px; background-color: #000000;
				 border-style:groove;border-width:3px;border-color: #FFCCCC; margin:10px 0px;}
	       	       td.term		{font:  10pt "细明体", Fixedsys, serif; color: #FFFFFF; }
		*.term_hd	{font:  10pt "细明体", Fixedsys, serif; color: #BBBBBB; }
		*.term_note	{font:  10pt "细明体", Fixedsys, serif; color: #777777; font-weight: normal }
		*.term_note_b	{font:  10pt "细明体", Fixedsys, serif; color: #FF77FF; font-weight: bolder }
		*.term_command	{font:  10pt "细明体", Fixedsys, serif; color: yellow ; font-weight: bolder }
		*.term_write	{font:  10pt "细明体", Fixedsys, serif; color: yellow ; font-weight: normal }
		*.term_say	{font:  10pt "细明体", Fixedsys, serif; color: #FF6666; font-weight: normal }
	</style>
	
</head>
<body style="margin:0; padding:0">
<center>


<!-- 这里是关于页首按钮处的按钮程式 -->
<div style="text-align:center">
<span style="font-weight:bolder; color:#3333FF"><span class="text_head0">鸟哥的<span class="text_head_en"> 
	Linux </span>私房菜</span></span><br />
<span style="color:#000080">为取得较佳浏览结果,请爱用 <a href="http://moztw.org" target="_blank">firefox</a>
	浏览本网页</span><br />
<a href="http://linux.vbird.org/" target="_blank"
	onmouseover="document.head_icon1.src='../images/icon_VBird_on.jpg'"
	onfocus="document.head_icon1.src='../images/icon_VBird_on.jpg'"
	onmouseout="document.head_icon1.src='../images/icon_VBird_off.jpg'">
	<img alt="前往鸟哥的 Linux 私房菜馆首页" title="前往鸟哥的 Linux 私房菜馆首页" name="head_icon1"
		src="../images/icon_VBird_off.jpg" border="0" /></a>
<a target="_blank" href="http://linux.vbird.org/linux_basic"
	onmouseover="document.head_icon2.src='../images/icon_basic_on.jpg'"
	onfocus="document.head_icon2.src='../images/icon_basic_on.jpg'"
	onmouseout="document.head_icon2.src='../images/icon_basic_off.jpg'">
	<img src="../images/icon_basic_off.jpg" border="0" 
		alt="前往 Linux 基础文件,新手请从头学起" 
		title="前往 Linux 基础文件,新手请从头学起" name="head_icon2" /></a>
<a target="_blank" href="http://linux.vbird.org/linux_server"
	onmouseover="document.head_icon3.src='../images/icon_server_on.jpg'"
	onfocus="document.head_icon3.src='../images/icon_server_on.jpg'"
	onmouseout="document.head_icon3.src='../images/icon_server_off.jpg'">
	<img src="../images/icon_server_off.jpg" border="0"
		alt="前往 Linux 架站文件,网路基础那章节请务必参考!" 
		title="前往 Linux 架站文件,网路基础那章节请务必参考!" name="head_icon3" /></a>
<a target="_blank" href="http://linux.vbird.org/linux_security"
	onmouseover="document.head_icon4.src='../images/icon_security_on.jpg'"
	onfocus="document.head_icon4.src='../images/icon_security_on.jpg'"
	onmouseout="document.head_icon4.src='../images/icon_security_off.jpg'">
	<img src="../images/icon_security_off.jpg" border="0"
		alt="前往『网路安全』相关文件网页" title="前往『网路安全』相关文件网页" name="head_icon4" /></a>
<a href="http://phorum.vbird.org" target="_blank"
	onmouseover="document.head_icon5.src='../images/icon_forum_on.jpg'"
	onfocus="document.head_icon5.src='../images/icon_forum_on.jpg'"
	onmouseout="document.head_icon5.src='../images/icon_forum_off.jpg'">
	<img src="../images/icon_forum_off.jpg" border="0"
		alt="前往 Linux 新手讨论区,发问前务必查阅发文规则" 
		title="前往 Linux 新手讨论区,发问前务必查阅发文规则" name="head_icon5" /></a>
<a target="_blank" href="http://linux.vbird.org/adsl"
	onmouseover="document.head_icon6.src='../images/icon_adsl_on.jpg'"
	onfocus="document.head_icon6.src='../images/icon_adsl_on.jpg'"
	onmouseout="document.head_icon6.src='../images/icon_adsl_off.jpg'">
	<img src="../images/icon_adsl_off.jpg" border="0"
		alt="前往『ADSL连线分享』相关文件网页" title="前往『ADSL连线分享』相关文件网页" name="head_icon6" /></a>
<a href="http://www.study-area.org" target="_blank"
	onmouseover="document.head_icon7.src='../images/icon_study-area.jpg'"
	onfocus="document.head_icon7.src='../images/icon_study-area.jpg'"
	onmouseout="document.head_icon7.src='../images/icon_study-area.jpg'">
	<img src="../images/icon_study-area.jpg" border="0"
		alt="前往 Study Area 网站" title="前往 Study Area 网站" name="head_icon7" /></a>
<br />
</div>


<table summary="本文内容的排版" style="width:750px; 
	background-image:url('../images/VBirdLinux.jpg');
	background-attachment:fixed;" border="0" cellspacing="0" cellpadding="0">
<tr><td style="width:16px; height:16px; background-image:url('../images/border-top-left.jpg'); 
	font-size:6px">  </td>
    <td style="width:718px; height:16px; font-size:6px;
	background-image:url('../images/border-top-center.jpg')">  </td>
    <td style="width:16px; height:16px; background-image:url('../images/border-top-right.jpg');
	font-size:6px">  </td></tr>
<tr><td style="width:16px; font-size:6px;
	background-image:url('../images/border-middle-left.jpg')">  </td>
    <td width="718">

<!-- 本文的档头部分 -->
<div style="text-align:center">
    <a href="0430cron.php">
    <span class="text_head0">例行性命令的建立</span></a><br />
</div>
    <div style="text-align:left">
        <a href="0430cron.php?thisscreen=800x600"><!--切换解析度为 800x600--></a>
    </div>
    <div style="text-align:right">
        <span class="text_history">最近更新日期∶2005/09/07</span>
    </div>

<!-- 本文的档头部分 -->
<table class="head1" summary="排版∶文章档头的说明"><tr><td class="head1">
	不论什么时候,建立系统可以自动的执行功能都是必须的!您了解目前系统在预设的情况中,
	每天、每小时、每个月都在做些什么事吗?!您了解『循环的工作』与『仅进行一次的工作』有什么不同吗?
	还有还有,如果你想要每年的老婆的生日前一天就发出一封信件提醒自己不要忘记;
	又,如果是与初次见面的朋友的约会,又该如何设定啊?看看这一章先!
</td></tr></table><br>

<!-- 本文的连结区部分 -->
<div class=block1>
<span class="text_h1">
1. <a href="#whatiscron">什么是例行性命令</a><br>
	<span class=text_h2>
	    1.1 <a href="#whatiscron_type">Linux 工作排程的种类∶ at, cron</a><br>
	    1.2 <a href="#whatiscron_linux">系统上常见的例行性命令有哪些?</a><br>
	</span>
2. <a href="#atjob">仅执行一次的工作排程∶</a> <a href="#at">at</a>, <a href="#atq_atrm">atq, atrm</a><br>
3. <a href="#cron">循环执行的例行性命令∶ cron</a><br>
	<span class=text_h2>
	    3.1 <a href="#crontab">使用者的设定∶ crontab</a><br>
	    3.2 <a href="#etc_crontab">系统的设定∶ /etc/crontab</a><br>
	</span>
4. <a href="#security">一些使用特点∶</a><br>
5. <a href="#FAQ">本章习题练习∶</a><br>
<span class=text_h2>
6. <a href="http://phorum.vbird.org/viewtopic.php?t=23889"
    target="_blank">针对本文的建议∶http://phorum.vbird.org/viewtopic.php?t=23889</a>
</span>
</span>
</div>


<!-- 本文的正式部分 -->
<hr><a NAME="whatiscron"></a><img src="images/penguin-m.gif" alt="大标题的图示" height="34" width="25" align="middle" /><span class="text_h1">什么是例行性命令?</span><br>
<div class=block1>
	每个人或多或少都有一些约会或者是工作,有的工作是例行性的,例如每年一次的加薪、
	每个月一次的工作报告、每周一次的午餐会报、每天需要的打卡等等;
	有的工作则是临时发生的,例如刚好总公司有高官来访,需要你准备演讲器材等等!
	用在生活上面,例如每年的爱人的生日、每天的起床时间等等、还有突发性的电脑大降价 
	(阿~鸟哥等好久了~~) 等等棉。<br><br>

	上面这些工作都可以称为例行性命令,而这些工作 Linux 也都可以帮您提醒,例如∶每一天早上 
	8:00 钟要伺服器连接上音响,并启动音乐来唤你起床;而中午
	12:00 希望 Linux 可以发一封信到你的邮件信箱,提醒你可以去吃午餐了;
	另外,在每年的你爱人的生日的前一天,先发封信提醒你,以免忘记这么重要的一天。<br><br>

	<hr><a name=whatiscron_type></a><img src="../images/penguin-s.gif" alt="小标题的图示" height="23" width="16" align="middle" /><span class=text_h2>Linux 工作排程的种类∶ 
	at, cron</span><br>
	<div class=block2>
		从上面的说明当中可以很清楚的发现两种工作排程的方式∶
		<ul>
		<li>一种是例行性的,就是每隔一定的周期要来办的事项;</li>
		<li>一种是突发性的,就是这次做完以后就没有的那一种(电脑大降价....)</li></ul>

		那么在 Linux 底下如何达到这两个功能呢?呵呵!那就得使用 at 与 crontab 这两个好东西棉!
		<ul>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -