<?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>Peter Glaeser &#187; MySQL</title>
	<atom:link href="http://www.peterglaeser.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peterglaeser.com</link>
	<description>opinions on online marketing, mobile advertising and technology</description>
	<lastBuildDate>Tue, 27 Sep 2011 07:00:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Backup Scripts for Your Server</title>
		<link>http://www.peterglaeser.com/backup-scripts-for-your-server/</link>
		<comments>http://www.peterglaeser.com/backup-scripts-for-your-server/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 17:46:29 +0000</pubDate>
		<dc:creator>Peter Glaeser</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.affiliatetracking.de/backup-scripts-for-your-server/</guid>
		<description><![CDATA[In a previous comment I was asked to post a backup procedure that I use on my root servers. The following is a backup stategy that I use on my SuSE servers. Backup directories You create the following directories: /root/backup/scripts &#8230; <a href="http://www.peterglaeser.com/backup-scripts-for-your-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In a previous comment I was asked to post a backup procedure that I use on my root servers. The following is a backup stategy that I use on my SuSE servers.</p>
<h3>Backup directories</h3>
<p>You create the following directories:</p>
<ul>
<li>/root/backup/scripts</li>
<li>/root/backup/files</li>
</ul>
<h3>Hourly backup script</h3>
<p>Create /root/backup/scripts/1h.sh with the following contents and make it executable:<br />
<code>tar -czf /root/backup/files/partial_`date +%Y-%m-%d_%H-%M`.tar.gz `find /etc /home /srv /var -type f -mmin -60` 2> /dev/null<br />
find /root/backup/files -name 'partial*' -mtime +7 -exec unlink '{}' \;</code><br />
This creates backups of files that were changed in the past 60 minutes. Also it deletes those hourly backups that are older than 7 days.</p>
<h3>Daily backup script</h3>
<p>Create /root/backup/scripts/1d.sh with the following contents and make it executable:<br />
<code>rm /root/backup/files/complete*<br />
tar -czf /root/backup/files/complete.tar.gz /etc/ /home/ /srv/ /var/ 2> /dev/null<br />
lftp ftp://#username#:#password#@#host# -e "put /root/backup/files/complete.tar.gz; quit"</code></p>
<p>This creates a full daily backup of the important files of your server. That complete backup is then copied to an external FTP server. That way you can access your backup even if the whole machine becomes inaccessible. You may need to install the lftp program if it&#8217;s not on your machine by default.</p>
<p>You don&#8217;t need to create separate MySQL dumps. The MySQL data are stored in the /var structure, in my case under /var/lib/mysql/#database#.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterglaeser.com/backup-scripts-for-your-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Crashed WordPress MySQL Tables</title>
		<link>http://www.peterglaeser.com/crashed-wordpress-mysql-tables/</link>
		<comments>http://www.peterglaeser.com/crashed-wordpress-mysql-tables/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 19:55:30 +0000</pubDate>
		<dc:creator>Peter Glaeser</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.affiliatetracking.de/crashed-wordpress-mysql-tables/</guid>
		<description><![CDATA[Today I received a couple of my emails telling me that all posts of this blog were deleted. At first I thought people were kidding but then I got really scared. At first I thought somebody had hacked into my &#8230; <a href="http://www.peterglaeser.com/crashed-wordpress-mysql-tables/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I received a couple of my emails telling me that all posts of this blog were deleted. At first I thought people were kidding but then I got really scared. At first I thought somebody had hacked into my WordPress. But I always update all my blogs on the same day a new WordPress version comes out.</p>
<p>It turned out that the MySQL table containing the posts crashed. The MySQL log told me that by post table &#8220;is marked as crashed and should be repaired&#8221;. Great! But a little bit of research solved the problem. You need to go to the corresponding MySQL database directory, for example <em>/var/lib/mysql/wordpress</em>, and execute the following commands as root:</p>
<blockquote><p><em>/etc/init.d/mysql stop<br />
myisamchk -r wp_posts.MYI<br />
/etc/init.d/mysql start</em></p></blockquote>
<p>Problem solved within a few seconds. If that hadn&#8217;t worked I would have used my backups that are created hourly. Let me know if I should write something about backup strategies for standard root servers too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterglaeser.com/crashed-wordpress-mysql-tables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

