<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://opensimulator.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://opensimulator.org/index.php?action=history&amp;feed=atom&amp;title=Pruneterrain.php</id>
		<title>Pruneterrain.php - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://opensimulator.org/index.php?action=history&amp;feed=atom&amp;title=Pruneterrain.php"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Pruneterrain.php&amp;action=history"/>
		<updated>2026-05-12T04:30:22Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.9</generator>

	<entry>
		<id>http://opensimulator.org/index.php?title=Pruneterrain.php&amp;diff=28429&amp;oldid=prev</id>
		<title>MakoBot: Robot: Cosmetic changes</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Pruneterrain.php&amp;diff=28429&amp;oldid=prev"/>
				<updated>2012-03-04T04:01:21Z</updated>
		
		<summary type="html">&lt;p&gt;Robot: Cosmetic changes&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 04:01, 4 March 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Description==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Description ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Currently, the terrain revision table in the mysql database gets too big after a while(more than 1gb is no exception), so backups slow down greatly. This script prunes the revisions per region, thus limiting the maximum space which this table occupies. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Currently, the terrain revision table in the mysql database gets too big after a while(more than 1gb is no exception), so backups slow down greatly. This script prunes the revisions per region, thus limiting the maximum space which this table occupies. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Usage ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Save the script in your scripts directory, make it executable(chmod +x) and fire up like:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Save the script in your scripts directory, make it executable(chmod +x) and fire up like:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; ./pruneterrain.php sqlhostname sqluser sqlpw sqldb prunelimit&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; ./pruneterrain.php sqlhostname sqluser sqlpw sqldb prunelimit&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The prunelimit cuts off every revision after the amount you give(1-x). &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The prunelimit cuts off every revision after the amount you give(1-x). &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Souce==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Souce ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#!/usr/bin/php&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#!/usr/bin/php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MakoBot</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/index.php?title=Pruneterrain.php&amp;diff=23606&amp;oldid=prev</id>
		<title>MakoBot: Removed 'Template:' prefix from template includings and/or changed external-link into internal-link</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Pruneterrain.php&amp;diff=23606&amp;oldid=prev"/>
				<updated>2011-06-10T23:35:09Z</updated>
		
		<summary type="html">&lt;p&gt;Removed &amp;#039;Template:&amp;#039; prefix from template includings and/or changed external-link into internal-link&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:35, 10 June 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Template:&lt;/del&gt;Quicklinks}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{Quicklinks}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MakoBot</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/index.php?title=Pruneterrain.php&amp;diff=13366&amp;oldid=prev</id>
		<title>Ideia Boa at 23:57, 21 May 2009</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Pruneterrain.php&amp;diff=13366&amp;oldid=prev"/>
				<updated>2009-05-21T23:57:43Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:57, 21 May 2009&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;__NOTOC__&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;{{Template:Quicklinks}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br /&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Description==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Description==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Currently, the terrain revision table in the mysql database gets too big after a while(more than 1gb is no exception), so backups slow down greatly. This script prunes the revisions per region, thus limiting the maximum space which this table occupies. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Currently, the terrain revision table in the mysql database gets too big after a while(more than 1gb is no exception), so backups slow down greatly. This script prunes the revisions per region, thus limiting the maximum space which this table occupies. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ideia Boa</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/index.php?title=Pruneterrain.php&amp;diff=6040&amp;oldid=prev</id>
		<title>Phrearch: Prune Terrain moved to Pruneterrain.php: using filenames is better</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Pruneterrain.php&amp;diff=6040&amp;oldid=prev"/>
				<updated>2008-05-20T14:42:51Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;a href=&quot;/wiki/Prune_Terrain&quot; class=&quot;mw-redirect&quot; title=&quot;Prune Terrain&quot;&gt;Prune Terrain&lt;/a&gt; moved to &lt;a href=&quot;/wiki/Pruneterrain.php&quot; title=&quot;Pruneterrain.php&quot;&gt;Pruneterrain.php&lt;/a&gt;: using filenames is better&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 14:42, 20 May 2008&lt;/td&gt;
			&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Phrearch</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/index.php?title=Pruneterrain.php&amp;diff=6039&amp;oldid=prev</id>
		<title>Phrearch: New page: ==Description== Currently, the terrain revision table in the mysql database gets too big after a while(more than 1gb is no exception), so backups slow down greatly. This script prunes the ...</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Pruneterrain.php&amp;diff=6039&amp;oldid=prev"/>
				<updated>2008-05-20T14:42:16Z</updated>
		
		<summary type="html">&lt;p&gt;New page: ==Description== Currently, the terrain revision table in the mysql database gets too big after a while(more than 1gb is no exception), so backups slow down greatly. This script prunes the ...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Description==&lt;br /&gt;
Currently, the terrain revision table in the mysql database gets too big after a while(more than 1gb is no exception), so backups slow down greatly. This script prunes the revisions per region, thus limiting the maximum space which this table occupies. &lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
Save the script in your scripts directory, make it executable(chmod +x) and fire up like:&lt;br /&gt;
 ./pruneterrain.php sqlhostname sqluser sqlpw sqldb prunelimit&lt;br /&gt;
The prunelimit cuts off every revision after the amount you give(1-x). &lt;br /&gt;
&lt;br /&gt;
==Souce==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
//First do some basic parameter checking&lt;br /&gt;
if (sizeof($argv)!=6) {&lt;br /&gt;
echo &amp;quot;\nInvalid amount of parameters!\nUsage:&amp;quot;.$argv[0].&amp;quot; host user pw db limit\n&amp;quot;;&lt;br /&gt;
die;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
	foreach($argv as $arg){&lt;br /&gt;
		if(empty($arg)){&lt;br /&gt;
		echo &amp;quot;\nInvalid parameter input!\nUsage:&amp;quot;.$argv[0].&amp;quot; host user pw db limit\n&amp;quot;;&lt;br /&gt;
		die;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
$host = $argv[1];&lt;br /&gt;
$username = $argv[2];&lt;br /&gt;
$password = $argv[3];&lt;br /&gt;
$database = $argv[4];&lt;br /&gt;
	if(intval($argv[5]) &amp;gt; 0) {&lt;br /&gt;
	$prunelimit = $argv[5];&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
	echo &amp;quot;Enter a valid Prune-limit!(&amp;gt; 1). You don't want to loose your work do you?\n&amp;quot;;&lt;br /&gt;
	die;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$connect = mysql_connect($host, $username, $password);&lt;br /&gt;
	if (!$connect) {&lt;br /&gt;
	die('Could not connect: ' . mysql_error());&lt;br /&gt;
	}&lt;br /&gt;
	mysql_select_db($database);&lt;br /&gt;
	//Get unique regions from terrain table&lt;br /&gt;
	$query = &amp;quot;SELECT uuid,regionName from regions&amp;quot;;&lt;br /&gt;
	$result = mysql_query($query);&lt;br /&gt;
	if(!$result) die(&amp;quot;Query Failed.&amp;quot;);&lt;br /&gt;
	//For every unique Region&lt;br /&gt;
	$tempspace = 0;&lt;br /&gt;
	$space = 0;&lt;br /&gt;
	while ($row = mysql_fetch_assoc($result)) {&lt;br /&gt;
	$query = &amp;quot;SELECT RegionUUID,Revision from terrain WHERE RegionUUID = '&amp;quot;.ereg_replace(&amp;quot;-&amp;quot;, &amp;quot;&amp;quot;, $row['uuid']).&amp;quot;' ORDER BY Revision DESC&amp;quot;;&lt;br /&gt;
	$nextresult = mysql_query($query);&lt;br /&gt;
	//Get the amount of revisions&lt;br /&gt;
	$revnum = mysql_num_rows($nextresult);&lt;br /&gt;
		//If revision amount exceeds the prune-limit&lt;br /&gt;
		if($revnum &amp;gt; $prunelimit) {&lt;br /&gt;
		$tempspace = (($revnum - $prunelimit) / 2);&lt;br /&gt;
		echo &amp;quot;Freeing &amp;quot;.$tempspace.&amp;quot;MB of data from &amp;quot;.$row['regionName'].&amp;quot;\n&amp;quot;;&lt;br /&gt;
		mysql_data_seek($nextresult, ($prunelimit));&lt;br /&gt;
			if($lastrow = mysql_fetch_assoc($nextresult)) {&lt;br /&gt;
			$query = &amp;quot;DELETE FROM terrain WHERE Revision &amp;lt;= '&amp;quot;.$lastrow['Revision'].&amp;quot;'&amp;quot;;&lt;br /&gt;
			mysql_query($query) or die (mysql_error());&lt;br /&gt;
			$space += $tempspace;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	echo &amp;quot;Totally removed &amp;quot;.$space.&amp;quot;MB of terrain-revision data...\n&amp;quot;;&lt;br /&gt;
	mysql_close($connect);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phrearch</name></author>	</entry>

	</feed>