<?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>深度VPS &#187; 自动运行</title>
	<atom:link href="http://www.deepvps.com/tag/%E8%87%AA%E5%8A%A8%E8%BF%90%E8%A1%8C/feed" rel="self" type="application/rss+xml" />
	<link>http://www.deepvps.com</link>
	<description>专注VPS技术，关注前端技术</description>
	<lastBuildDate>Sat, 04 Feb 2023 14:00:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Centos开机自动运行.sh程序的方法</title>
		<link>http://www.deepvps.com/automatically-run-sh-of-centos.html</link>
		<comments>http://www.deepvps.com/automatically-run-sh-of-centos.html#comments</comments>
		<pubDate>Sun, 26 Feb 2012 15:41:34 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[VPS入门]]></category>
		<category><![CDATA[.sh]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[自动运行]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=1052</guid>
		<description><![CDATA[有时候呢，我们需要在Centos系统启动的时候运行程序，这样保证一些服务就没有中断，相信你理解是什么意思。其实方法很简单呐，就是把需要运行的程序放在/etc/rc.d/rc.local里面就可以启动了，编辑rc.local这个文件。写下路径和程序。我们做个简单的实验看看就明白了：
假如我要记录每次系统启动的时间，有个简单的方法，就是让系统启动以后运行一下date这个命令，把结果从后面添加写到一个文件，查看这个文件就知道每次系统启动的时间了。
date &#62;&#62;/root/rtime.txt

首先使用命令:  vi /etc/rc.d/rc.local 

在最后面添加一行 date &#62;&#62;/root/rtime.txt
 
这里可以看到服务器上面还有个vsftpd程序是开机自动运行的，后面那个&#38; 意思是后台运行。
]]></description>
			<content:encoded><![CDATA[<p>有时候呢，我们需要在Centos系统启动的时候运行程序，这样保证一些服务就没有中断，相信你理解是什么意思。其实方法很简单呐，就是把需要运行的程序放在/etc/rc.d/rc.local里面就可以启动了，编辑rc.local这个文件。写下路径和程序。我们做个简单的实验看看就明白了：</p>
<p>假如我要记录每次系统启动的时间，有个简单的方法，就是让系统启动以后运行一下date这个命令，把结果从后面添加写到一个文件，查看这个文件就知道每次系统启动的时间了。</p>
<p>date &gt;&gt;/root/rtime.txt<br />
<span id="more-1052"></span></p>
<p>首先使用命令:  vi /etc/rc.d/rc.local </p>
<p><a rel="example4" href="http://www.deepvps.com/wp-content/uploads/auto_save_image/2012/02/154326tKF.jpg"><img title="1" src="http://www.deepvps.com/wp-content/uploads/auto_save_image/2012/02/154326tKF.jpg" alt="" width="382" height="24" /></a></p>
<p>在最后面添加一行 date &gt;&gt;/root/rtime.txt</p>
<p><a rel="example4" href="http://www.deepvps.com/wp-content/uploads/auto_save_image/2012/02/234332PTd.jpg"><img src="http://www.deepvps.com/wp-content/uploads/auto_save_image/2012/02/234332PTd.jpg" alt="" width="540" height="160" /></a> </p>
<p>这里可以看到服务器上面还有个vsftpd程序是开机自动运行的，后面那个&amp; 意思是后台运行。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/automatically-run-sh-of-centos.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
