﻿<?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>FreeMAGi &#187; eAccelerator</title>
	<atom:link href="http://www.freemagi.com/tag/eaccelerator/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.freemagi.com</link>
	<description>time waits for no one.</description>
	<lastBuildDate>Sat, 12 Dec 2009 08:11:21 +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>Update, PHP-4.4.4! Update, eAccelerator! Update, WordPress 2.0.6!</title>
		<link>http://www.freemagi.com/2007/01/07/update-update-update/</link>
		<comments>http://www.freemagi.com/2007/01/07/update-update-update/#comments</comments>
		<pubDate>Sun, 07 Jan 2007 14:30:00 +0000</pubDate>
		<dc:creator>Evan</dc:creator>
				<category><![CDATA[DreamHost]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Compile]]></category>
		<category><![CDATA[eAccelerator]]></category>
		<category><![CDATA[Script]]></category>
		<guid isPermaLink="false">http://www.freemagi.com/2007/01/07/update-update-update/</guid>
		<description><![CDATA[[photopress:Night_of_Miracles_by_Licheus.jpg,full,pp_image] 前几天在robinz那看到了在Dreamhost上安装eAccelerator的教程，听说eAccelerator要比zend快多了，手就有点痒，这几天都在尝试编译安装PHP-4.4.4，但已经出错了三次，大都是因为脚本的问题，准备第四次的时候竟然一不小心rm -rf php *差点把所有东西都删了，幸好还有较早前的备份才恢复过来，今天就把WordPress升到2.0.6，趁还有时间顺便也把页面的css调整了一下，加了两张背景。 实际动手才发觉跟想象的也差太远了，安装PHP4就是因为参数和网数的问题令成功几率大大降低，而且在网上的那些脚本多数都不太完全对的，需要改动的地方也不少。就PHP4的编译小弟也积累了些经验， 刚开始我只按照robinz的方法装的，但是因为php4已经出到4.4.4了，而iMap也升级到2006了，2004g的下载地址也已经失效了，还有一好几个文件镜像都失效，后来只好参照Dreamhost官方提供的脚本重新编译，而又因为Dreamhost的脚本写的比较优美，所以我最后还是以它为基础按照robinz的参数重新安装。在这里有几点要注意的，Dreamhost提供的脚本是默认没有打开FastCGI参数的，而robinz上面又有几个变量稍微不同，还有编译的时候最好把脚本放到$HOME目录执行，这样才不会产生多余的php链接。 下面是我修改过的脚本 #!/bin/bash # Abort on any errors set -e # The domain in which to install the PHP CGI script. export DOMAIN="freemagi.com" # Update version information here. PHP="php-4.4.4" LIBICONV="libiconv-1.10" LIBMCRYPT="libmcrypt-2.5.7" LIBXML2="libxml2-2.6.23" LIBXSLT="libxslt-1.1.15" MHASH="mhash-0.9.4"; MHASH_TAR="${MHASH}a" # Pests! ZLIB="zlib-1.2.3" CURL="curl-7.15.2" LIBIDN="libidn-0.6.2" FREETYPE="freetype-2.1.10" IMAP="imap-2004g" # Set DISTDIR to somewhere persistent if [...]]]></description>
			<content:encoded><![CDATA[<p>[photopress:Night_of_Miracles_by_Licheus.jpg,full,pp_image]</p>
<p>前几天在<a href="http://blog.robinz.info/archives/2006/02/15/how-to-install-eacceleartor-on-dreamhosts-host/" target="_blank" title="How to Install eAcceleartor on Dreamhost’s HOST!">robinz</a>那看到了在<a href="http://www.dreamhost.com/r.cgi?251337" title="Dreamhost">Dreamhost</a>上安装eAccelerator的教程，听说<a href="http://www.chedong.com/blog/archives/001154.html" target="_blank" title="eAccelerator的安装和性能比较">eAccelerator要比zend快</a>多了，手就有点痒，这几天都在尝试编译安装PHP-4.4.4，但已经出错了三次，大都是因为脚本的问题，准备第四次的时候竟然一不小心rm -rf php *差点把所有东西都删了，幸好还有较早前的备份才恢复过来，今天就把WordPress升到2.0.6，趁还有时间顺便也把页面的css调整了一下，加了两张背景。</p>
<p>实际动手才发觉跟想象的也差太远了，安装PHP4就是因为参数和网数的问题令成功几率大大降低，而且在网上的那些脚本多数都不太完全对的，需要改动的地方也不少。就PHP4的编译小弟也积累了些经验， 刚开始我只按照<a href="http://blog.robinz.info/archives/2006/02/13/how-to-compile-php-442-on-dreamhosts-web-hosts/" target="_blank" title="How to compile PHP 4.4.2 on Dreamhost’s web hosts.">robinz</a>的方法装的，但是因为php4已经出到4.4.4了，而iMap也升级到2006了，2004g的下载地址也已经失效了，还有一好几个文件镜像都失效，后来只好参照<a href="http://www.dreamhost.com/r.cgi?251337" title="Dreamhost">Dreamhost</a>官方提供的<a href="http://wiki.dreamhost.com/index.php/Custom_compile_PHP_4" title="Installing PHP4">脚本</a>重新编译，而又因为<a href="http://www.dreamhost.com/r.cgi?251337" title="Dreamhost">Dreamhost</a>的脚本写的比较优美，所以我最后还是以它为基础按照<a href="http://blog.robinz.info/archives/2006/02/13/how-to-compile-php-442-on-dreamhosts-web-hosts/" target="_blank" title="How to compile PHP 4.4.2 on Dreamhost’s web hosts.">robinz</a>的参数重新安装。在这里有几点要注意的，<a href="http://www.dreamhost.com/r.cgi?251337" title="Dreamhost">Dreamhost</a>提供的脚本是默认没有打开FastCGI参数的，而<a href="http://blog.robinz.info/archives/2006/02/13/how-to-compile-php-442-on-dreamhosts-web-hosts/" target="_blank" title="How to compile PHP 4.4.2 on Dreamhost’s web hosts.">robinz</a>上面又有几个变量稍微不同，还有编译的时候最好把脚本放到$HOME目录执行，这样才不会产生多余的php链接。</p>
<p><span style="color: #8080c0">下面是我修改过的脚本</span></p>
<p><span id="more-15"></span></p>
<blockquote><p>#!/bin/bash</p>
<p># Abort on any errors<br />
set -e</p>
<p># The domain in which to install the PHP CGI script.<br />
export DOMAIN="freemagi.com"</p>
<p># Update version information here.<br />
PHP="php-4.4.4"<br />
LIBICONV="libiconv-1.10"<br />
LIBMCRYPT="libmcrypt-2.5.7"<br />
LIBXML2="libxml2-2.6.23"<br />
LIBXSLT="libxslt-1.1.15"<br />
MHASH="mhash-0.9.4"; MHASH_TAR="${MHASH}a" # Pests!<br />
ZLIB="zlib-1.2.3"<br />
CURL="curl-7.15.2"<br />
LIBIDN="libidn-0.6.2"<br />
FREETYPE="freetype-2.1.10"<br />
IMAP="imap-2004g"<br />
# Set DISTDIR to somewhere persistent if you plan to muck around with this<br />
# script and run it several times! It is where distributions are downloaded.<br />
DISTDIR=${HOME}/dist</p>
<p># Where do you want all this stuff built? Using a local filesystem is best.<br />
# ***Don't pick a directory that already exists!*** We clean up after<br />
# ourselves at the end!<br />
SRCDIR=${HOME}/source</p>
<p># And where should it be installed? A versioned directory eases upgrades!<br />
INSTALLDIR=${HOME}/${PHP}</p>
<p># A simple name link eases use<br />
ln -s ${INSTALLDIR} php<br />
# What PHP features do you want enabled?<br />
PHPFEATURES="--prefix=${INSTALLDIR} \<br />
--enable-force-cgi-redirect \<br />
--enable-gd-native-ttf \<br />
--enable-ftp \<br />
--enable-sockets \<br />
--enable-wddx \<br />
--enable-sqlite-utf8 \<br />
--enable-calendar \<br />
--enable-mbstring \<br />
--enable-mbregex \<br />
--enable-soap \<br />
--enable-fastcgi \<br />
--enable-exif \<br />
--with-config-file-path=${INSTALLDIR}/etc/php4 \<br />
--with-xml \<br />
--with-libxml-dir=${INSTALLDIR} \<br />
--with-freetype-dir=${INSTALLDIR} \<br />
--with-xsl=${INSTALLDIR} \<br />
--with-openssl=/usr \<br />
--with-mhash=${INSTALLDIR} \<br />
--with-mcrypt=${INSTALLDIR} \<br />
--with-zlib-dir=${INSTALLDIR} \<br />
--with-jpeg-dir=/usr \<br />
--with-png-dir=/usr \<br />
--with-gd \<br />
--with-mysql=/usr --with-mysqli \<br />
--with-curl=${INSTALLDIR} \<br />
--with-iconv=${INSTALLDIR} \<br />
--with-imap=${INSTALLDIR}<br />
--with-imap-ssl=/usr \<br />
--with-gettext \<br />
--without-pear"</p>
<p># ---- end of user-editable bits. Hopefully! ----</p>
<p># Push the install dir's bin directory into the path<br />
export PATH=${INSTALLDIR}/bin:$PATH</p>
<p>#setup directories<br />
mkdir -p ${SRCDIR}<br />
mkdir -p ${INSTALLDIR}<br />
mkdir -p ${DISTDIR}<br />
cd ${DISTDIR}</p>
<p># Get all the required packages<br />
wget -c <a href="http://us3.php.net/distributions/$%7BPHP%7D.tar.gz">http://us3.php.net/distributions/${PHP}.tar.gz</a><br />
wget -c <a href="http://ftp.gnu.org/pub/gnu/libiconv/$%7BLIBICONV%7D.tar.gz">http://ftp.gnu.org/pub/gnu/libiconv/${LIBICONV}.tar.gz</a><br />
wget -c <a href="http://easynews.dl.sourceforge.net/sourceforge/mcrypt/$%7BLIBMCRYPT%7D.tar.gz">http://easynews.dl.sourceforge.net/sourceforge/mcrypt/${LIBMCRYPT}.tar.gz</a><br />
wget -c <a href="http://xmlsoft.org/sources/xml/$%7BLIBXML2%7D.tar.gz">http://xmlsoft.org/sources/xml/${LIBXML2}.tar.gz</a><br />
wget -c <a href="http://xmlsoft.org/sources/xml/$%7BLIBXSLT%7D.tar.gz">http://xmlsoft.org/sources/xml/${LIBXSLT}.tar.gz</a><br />
wget -c <a href="http://easynews.dl.sourceforge.net/sourceforge/mhash/$%7BMHASH_TAR%7D.tar.gz">http://easynews.dl.sourceforge.net/sourceforge/mhash/${MHASH_TAR}.tar.gz</a><br />
wget -c <a href="http://www.zlib.net/$%7BZLIB%7D.tar.gz">http://www.zlib.net/${ZLIB}.tar.gz</a><br />
wget -c <a href="http://curl.haxx.se/download/$%7BCURL%7D.tar.gz">http://curl.haxx.se/download/${CURL}.tar.gz</a><br />
wget -c <a href="ftp://alpha.gnu.org/pub/gnu/libidn/$%7BLIBIDN%7D.tar.gz">ftp://alpha.gnu.org/pub/gnu/libidn/${LIBIDN}.tar.gz</a><br />
wget -c <a href="http://easynews.dl.sourceforge.net/sourceforge/freetype/$%7BFREETYPE%7D.tar.gz">http://easynews.dl.sourceforge.net/sourceforge/freetype/${FREETYPE}.tar.gz</a><br />
wget -c <a href="ftp://ftp.cac.washington.edu/imap/old/$%7BIMAP%7D.tar.Z">ftp://ftp.cac.washington.edu/imap/old/${IMAP}.tar.Z</a></p>
<p>cd ${SRCDIR}<br />
# Unpack them all<br />
tar xzf ${DISTDIR}/${PHP}.tar.gz<br />
tar xzf ${DISTDIR}/${LIBICONV}.tar.gz<br />
tar xzf ${DISTDIR}/${LIBMCRYPT}.tar.gz<br />
tar xzf ${DISTDIR}/${LIBXML2}.tar.gz<br />
tar xzf ${DISTDIR}/${LIBXSLT}.tar.gz<br />
tar xzf ${DISTDIR}/${MHASH_TAR}.tar.gz<br />
tar xzf ${DISTDIR}/${ZLIB}.tar.gz<br />
tar xzf ${DISTDIR}/${CURL}.tar.gz<br />
tar xzf ${DISTDIR}/${LIBIDN}.tar.gz<br />
tar xzf ${DISTDIR}/${FREETYPE}.tar.gz<br />
uncompress -cd ${DISTDIR}/${IMAP}.tar.Z |tar x</p>
<p># Build them in the required order to satisfy dependencies.</p>
<p>#libiconv<br />
cd ${SRCDIR}/${LIBICONV}<br />
./configure --enable-extra-encodings --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#libxml2<br />
cd ${SRCDIR}/${LIBXML2}<br />
./configure --with-iconv=${INSTALLDIR} --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#libxslt<br />
cd ${SRCDIR}/${LIBXSLT}<br />
./configure --with-libxml-prefix=${INSTALLDIR} --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#zlib<br />
cd ${SRCDIR}/${ZLIB}<br />
./configure --shared --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#libmcrypt<br />
cd ${SRCDIR}/${LIBMCRYPT}<br />
./configure --disable-posix-threads --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#mhash<br />
cd ${SRCDIR}/${MHASH}<br />
./configure --prefix=${INSTALLDIR}<br />
make<br />
make install<br />
# FIXME: For some reason, mincludes.h isn't copied across<br />
cp ${SRCDIR}/${MHASH}/include/mutils/mincludes.h ${INSTALLDIR}/include/mutils</p>
<p>#libidn<br />
cd ${SRCDIR}/${LIBIDN}<br />
./configure --with-iconv-prefix=${INSTALLDIR} --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#cURL<br />
cd ${SRCDIR}/${CURL}<br />
./configure --with-ssl=${INSTALLDIR} --with-zlib=${INSTALLDIR} \<br />
--with-libidn=${INSTALLDIR} --enable-ipv6 --enable-cookies \<br />
--enable-crypto-auth --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#freetype<br />
cd ${SRCDIR}/${FREETYPE}<br />
./configure --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p># imap<br />
cd ${SRCDIR}/${IMAP}<br />
make ldb<br />
# Install targets are for wusses!<br />
cp c-client/c-client.a ${INSTALLDIR}/lib/libc-client.a<br />
cp c-client/*.h ${INSTALLDIR}/include</p>
<p>#PHP 4<br />
cd ${SRCDIR}/${PHP}<br />
./configure ${PHPFEATURES}<br />
make<br />
make install</p>
<p>#copy config file<br />
mkdir -p ${INSTALLDIR}/etc/php4<br />
cp ${SRCDIR}/${PHP}/php.ini-dist ${INSTALLDIR}/etc/php4/php.ini</p>
<p>#copy PHP CGI<br />
mkdir -p ${HOME}/${DOMAIN}/cgi-bin<br />
chmod 0755 ${HOME}/${DOMAIN}/cgi-bin<br />
cp ${INSTALLDIR}/bin/php ${HOME}/${DOMAIN}/cgi-bin/php.cgi<br />
echo ---------- INSTALL COMPLETE! ----------</p></blockquote>
<p><strong>Download:</strong> <a href="http://freemagi.com/wp-content/uploads/instphp4.sh">instphp4.sh</a></p>
<p>运行</p>
<blockquote><p><code>chmod +x instphp4.sh<br />
./instphp4.sh</code></p></blockquote>
<hr />然后就到安装我们这次的主角eAcceleartor，开始安装前还要几步准备工作，先把autoconf和automake装上，可以参考<a href="http://blog.robinz.info/archives/2006/02/15/how-to-install-eacceleartor-on-dreamhosts-host/" target="_blank" title="How to Install eAcceleartor on Dreamhost’s HOST!">robinz</a>的做法，而我是选择安装在~/local，因个人情况不同。安装autoconf</p>
<blockquote><p><code>wget <a href="http://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.bz2">http://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.bz2</a><br />
tar -xjf autoconf-2.59.tar.bz2<br />
cd autoconf-2.59<br />
./configure -prefix=YOUR PATH<br />
make<br />
make install</code></p></blockquote>
<p>安装automake</p>
<blockquote><p><code>wget <a href="http://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.bz2">http://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.bz2</a><br />
tar -xjf automake-1.9.6.tar.bz2<br />
cd automake-1.9.6<br />
./configure -prefix=YOUR PATH<br />
make<br />
make install</code></p></blockquote>
<p>然后我们来看看eAccelerator的软件环境需求：<br />
apache 1.3, apache 2.0 (prefork), mod_php4/5<br />
我们的<a href="http://www.dreamhost.com/r.cgi?251337" title="Dreamhost">Dreamhost</a>都能够支持，好了，下面到请主角出场：</p>
<p>安装eAccelerator（下面的地址如果不通的话最好自己到eAccelerator的<a href="http://sourceforge.net/projects/eaccelerator/" target="_blank" title="PojectPage">PojectPage</a>找合适的镜像）</p>
<blockquote><p>wget <a href="http://voxel.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.5.tar.bz2">http://voxel.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.5.tar.bz2</a><br />
tar -xjf eaccelerator-0.9.5.tar.bz2<br />
cd eaccelerator-0.9.5<br />
export PATH=$PATH:YOUR PATH/bin #这里的是指你安装autoconf的目录，譬如我的是$HOME/local/bin<br />
export PHP_PREFIX=YOUR PHP PATH #这里是你的安装php的位置，就是$HOME/php，但有一个小细节要注意的，在<a href="http://blog.robinz.info/archives/2006/02/15/how-to-install-eacceleartor-on-dreamhosts-host/" target="_blank" title="How to Install eAcceleartor on Dreamhost’s HOST!">robinz</a>的文里是写export PHP_PREFIX= YOUR PHP PATH/bin的，其实如果这样写的话，configure是不会成功的<br />
$PHP_PREFIX/bin/phpize<br />
./configure -prefix=YOUR PATH --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config<br />
make<br />
make install #最好还是make install一下，不make install会有la文件<br />
mv YOUR PHP PATH/lib/php/extensions/no-debug-non-zts-<span style="color: #800080">一行数字</span>/eaccelerator.so YOUR PHP PATH/lib/php/extensions/<br />
rm -r YOUR PHP PATH/lib/php/extensions/no-debug-non-zts-<span style="color: #800080">一行数字</span>/</p></blockquote>
<hr />上面结束以后还不用急，还要设置一下php.ini<br />
cp /etc/php/cgi/php.ini "$HOME/[your website directory]/cgi-bin/"<br />
然后再改一下这个复制过来的文件把文件末的以zend开头的两行都删掉<br />
把下面的这些文字加到文件末尾</p>
<blockquote><p><code>[eAccelerator]<br />
zend_extension="/home/YOUR PHP PATH/lib/php/extensions/eaccelerator.so"<br />
eaccelerator.shm_size="16"<br />
eaccelerator.cache_dir="/home/YOUR HOME/tmp/eaccelerator"<br />
eaccelerator.enable="1"<br />
eaccelerator.optimizer="1"<br />
eaccelerator.check_mtime="1"<br />
eaccelerator.debug="0"<br />
eaccelerator.filter=""<br />
eaccelerator.shm_max="0"<br />
eaccelerator.shm_ttl="0"<br />
eaccelerator.shm_prune_period="0"<br />
eaccelerator.shm_only="0"<br />
eaccelerator.compress="1"<br />
eaccelerator.compress_level="9"</code></p>
<p>[Zend]<br />
zend_extension="/usr/local/dh/apache/template/phpext/ZendExtensionManager.so"<br />
zend_extension="/usr/local/dh/apache/template/phpext/zend_optimizer4/ZendOptimizer.so"<br />
zend_optimizer.optimization_level=1023</p></blockquote>
<p>然后再运行</p>
<blockquote><p>mkdir -p ~/tmp/eaccelerator<br />
chmod 777 ~/tmp/eaccelerator</p></blockquote>
<p>最后，别忘了在你的.htaccess文件里加上</p>
<blockquote><p><code>AddHandler phpFour .php<br />
Action phpFour /cgi-bin/php.cgi</code></p></blockquote>
<p>再下一个<a href="http://depoch.net/download.htm" title="iProber 探针">iProber 探针</a>，看看PHPINFO就可以看到</p>
<blockquote><p>This program makes use of the Zend Scripting Language Engine:<br />
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with eAccelerator v0.9.5, Copyright (c) 2004-2006 eAccelerator, by eAccelerator with Zend Extension Manager v1.0.9, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v2.6.2, Copyright (c) 1998-2006, by Zend Technologies</p></blockquote>
<hr /><span style="font-size: 150%"><br />
<span style="font-family: Verdana">ENJOY!<br />
</span></span><span style="font-family: Verdana"><span style="font-family: Verdana">最后再附送两个备份脚本，分别是备份MySQL和文件到别的ftp上的脚本，写得比较草，不要笑小弟[发现几个错误，请把原asc改成gpg]<span style="font-family: Verdana"><code><br />
</code></span></span></span></p>
<blockquote><p><span style="font-family: Verdana"><code><span style="font-size: 100%">先是数据库备份脚本<br />
<code><span style="font-size: 100%">#ftp Info<br />
host=HOST #ftp host<br />
UserName=USER #ftp user name<br />
Passwd=PASSWD #fto user password</span></code></span></code></span></p>
<p>#MySQL Info<br />
SQL_host=DB_HOST #MySQL host<br />
SQL_User=DB_USER #MySQL UserName<br />
SQL_Passwd=DB_PASSWD #User Password<br />
SQL_db=DB_NAME #database name</p>
<p>backup_path=/home/YOUR TMP PATH #set saved backup path<br />
file=$SQL_db-$(date +%Y%m%d).tar.gz<br />
MySQL_path=/usr/bin #set the mysql database bin path</p>
<p>cd $backup_path<br />
#export database<br />
$MySQL_path/mysqldump -h $SQL_host -u$SQL_User -p$SQL_Passwd --databases $SQL_db&gt;$SQL_db.dump</p>
<p>sleep 5s<br />
#file tar<br />
tar -czf $backup_path/$file $SQL_db.dump<br />
gpg -e -r GPGID $file #有关gpg加解密请<a href="http://www.google.com/search?hl=zh-CN&amp;lr=&amp;newwindow=1&amp;q=gpg%E4%BD%BF%E7%94%A8&amp;suggest=1&amp;sa=X&amp;oi=cjkrefinements_zh-CN_nav&amp;ct=result&amp;cd=2" target="_blank" title="GOOGLE">GOOGLE一下</a></p>
<p>cd $backup_path</p>
<p>#file ftp<br />
ftp -i -n &lt;&lt;!<br />
open $host<br />
user $UserName $Passwd<br />
cd /dbbak #请事先在你的备份用FTP上建立此目录<br />
put $file.gpg<br />
bye<br />
!</p>
<p>sleep 10s<br />
rm -rf $backup_path/$file<br />
rm -rf $backup_path/$SQL_db.dump<br />
rm -rf $backup_path/$file.gpg</p>
<hr /></blockquote>
<blockquote><p><code>然后是文件备份的<br />
WEBFILE=webdir-$(date +%Y%m%d).tar.gz<br />
cd $HOME</code></p>
<p>sleep 1s<br />
tar -czf $HOME/YOUR TMP PATH/webdir-$(date +%Y%m%d).tar.gz $HOME/YOUR PATH</p>
<p>sleep 10s<br />
cd $HOME/YOUR TMP PATH<br />
gpg -e -r YOUR GPG ID $WEBFILE</p>
<p>sleep 15s<br />
ftp -i -n &lt;&lt;!<br />
open YOUR FTP HOST<br />
user USERNAME PASSWD<br />
cd webbak #这个也是要事先建好<br />
put $WEBFILE.gpg<br />
bye<br />
!</p>
<p>sleep 5s<br />
rm -rf $HOME/YOUR TMP PATH/$WEBFILE.gpg<br />
rm -rf $HOME/YOUR TMP PATH/$WEBFILE</p></blockquote>
<blockquote><hr /><span style="font-size: 150%; font-family: Verdana">Enjoy!</span></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.freemagi.com/2007/01/07/update-update-update/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
