<?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>waimv.com &#187; 备份</title>
	<atom:link href="http://www.waimv.com/tag/%e5%a4%87%e4%bb%bd/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.waimv.com</link>
	<description></description>
	<lastBuildDate>Fri, 09 Nov 2018 10:41:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>mysql 备份脚本</title>
		<link>http://www.waimv.com/mysql/151/</link>
		<comments>http://www.waimv.com/mysql/151/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 07:49:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[备份]]></category>

		<guid isPermaLink="false">http://www.szpian.com/?p=151</guid>
		<description><![CDATA[#!/bin/sh # mysql_backup.sh: backup mysql databases and keep newest 5 days backup. # ----------------------------- db_user="root" db_passwd="sdfsa" db_host="localhost" # the directory for story your backup file. backup_dir="/data/app/zahess/wwwroot/dbbackup" # date format for backup file (dd-mm-yyyy) time="$(date +"%d-%m-%Y")" # mysql, mysqldump and some other bin's path MYSQLDUMP="/usr/local/mysql/bin/mysqldump" MKDIR="$(which mkdir)" RM="$(which rm)" MV="$(which mv)" GZIP="$(which gzip)" # check the [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: bash">#!/bin/sh
# mysql_backup.sh: backup mysql databases and keep newest 5 days backup.
# -----------------------------
db_user="root"
db_passwd="sdfsa"
db_host="localhost"

# the directory for story your backup file.
backup_dir="/data/app/zahess/wwwroot/dbbackup"

# date format for backup file (dd-mm-yyyy)
time="$(date +"%d-%m-%Y")"

# mysql, mysqldump and some other bin's path
MYSQLDUMP="/usr/local/mysql/bin/mysqldump"
MKDIR="$(which mkdir)"
RM="$(which rm)"
MV="$(which mv)"
GZIP="$(which gzip)"

# check the directory for store backup is writeable
test ! -w $backup_dir &amp;&amp; echo "Error: $backup_dir is un-writeable." &amp;&amp; exit 0

# the directory for story the newest backup
test ! -d "$backup_dir" &amp;&amp; $MKDIR "$backup_dir"

# get all databases

for db in  wp_yang
do
        $MYSQLDUMP -u $db_user -h $db_host -p$db_passwd $db | $GZIP -9 &gt; "$backup_dir/$time.$db.gz"
done

#delete the oldest backup 7 days ago
find $backup_dir -name "*.gz" -mtime +7 |xargs rm -rf

exit 0;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.waimv.com/mysql/151/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
