<?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>ServerAdmins.NET &#187; tree</title>
	<atom:link href="http://serveradmins.net/tag/tree/feed/" rel="self" type="application/rss+xml" />
	<link>http://serveradmins.net</link>
	<description>Stuff for Server Admins...</description>
	<lastBuildDate>Fri, 09 Jul 2010 16:46:09 +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>Updating the FreeBSD Ports tree, easily&#8230;</title>
		<link>http://serveradmins.net/updating-the-freebsd-ports-tree-easily/</link>
		<comments>http://serveradmins.net/updating-the-freebsd-ports-tree-easily/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 01:18:00 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Utility]]></category>
		<category><![CDATA[fastest_cvsup]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ports]]></category>
		<category><![CDATA[portsnap]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[tree]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=52</guid>
		<description><![CDATA[How to get your FreeBDS ports tree updated and current, one way or another... =)

]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m feeling a bit lazy tonight, and wanted to get an update here, so for a bit I&#8217;ll show you a handy little tool to update your ports tree on FreeBSD.  After that, I&#8217;ll show you the ugly, old method.</p>
<p>Quick and easy&#8230;</p>
<p>Newer versions of FreeBSD come equipped with the &#8216;portsnap&#8217; utility.  This, makes it *VERY* simple to update your ports tree.  </p>
<p>For your first run, do this&#8230;<br />
<code><br />
portsnap fetch &#038;&#038; portsnap extract<br />
</code></p>
<p>This is going to grab a snapshot of the current ports tree, and simply extract it over your new tree, replacing *everything* as it goes.  You should only run the &#8216;extract&#8217; command the first time you run portsnap.</p>
<p>After that, you&#8217;ll want to run the following for any further updates&#8230;</p>
<p><code><br />
portsnap fetch &#038;&#038; portsnap update<br />
</code></p>
<p>Not only is this much quicker, it doesn&#8217;t overwrite everything. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you want to use this in a cron&#8217;d task, you should use the &#8216;portsnap cron 1&#8242; command.   It should be noted the number appended to the end of this is the number in seconds that portsnap will randomize the start of the app from.  For example, if you say &#8216;cron 2000&#8242;, portsnap will kick off *sometime* in the next 2000 seconds.  The reasoning for this is for larger serverfarms.  If you&#8217;re running that in cron on all of them and give portsnap a large window, it will keep them all from starting at the same time, loading the BSD servers and abusing your bandwidth.   I used 1 in the command above as I wasn&#8217;t really looking to use that. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Keep in mind this will only fetch the updates, you still need to update the tree afterwords&#8230;</p>
<p>A cron entry for this would look something like the following&#8230;</p>
<p><code><br />
0 3 * * * root /usr/sbin/portsnap cron &#038;&#038; /usr/sbin/portsnap update<br />
</code></p>
<p>So for normal, day to day operation once you&#8217;ve initialized your ports tree the following is what you&#8217;ll want to use and update.</p>
<p><code><br />
/usr/sbin/portsnap fetch &#038;&#038; /usr/sbin/portsnap update<br />
</code></p>
<p>Now, if you don&#8217;t have portsnap, you should use the following method to update your ports tree.  We&#8217;re going to go oldschool with cvsup here.</p>
<p>Edit:  From reader Bazzoola points out that this is outdated and antiquated and well, he&#8217;s 100% right.   Any current installations of FreeBSD should have the portsnap utility installed so this shouldn&#8217;t be necessary.  Consider it here for the sake of memories. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First of all, let&#8217;s find our fastest cvsup mirror&#8230;</p>
<p><code><br />
[root@R34 ~]# cd /usr/ports/sysutils/fastest_cvsup/<br />
[root@R34 /usr/ports/sysutils/fastest_cvsup]# make &#038;&#038; make install<br />
</code></p>
<p>This is going to install the &#8216;fastest_cvsup&#8217; port&#8230;  Afterwords, for the US locale, you can run the following to find your fastest cvsup mirror&#8230;</p>
<p><code><br />
[root@R34 /usr/ports/sysutils/fastest_cvsup]# fastest_cvsup  -c us<br />
>>  Querying servers in countries: us<br />
--> Connecting to cvsup.us.freebsd.org [72.233.193.64]...<br />
    - server replied: ! Access limit exceeded; try again later<br />
    - time taken: 69.51 ms<br />
--> Connecting to cvsup2.us.freebsd.org [130.94.149.166]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 27.19 ms<br />
--> Connecting to cvsup3.us.freebsd.org [128.31.0.28]...<br />
    - server replied: ! Access denied<br />
    - time taken: 31.65 ms<br />
--> Connecting to cvsup4.us.freebsd.org [149.20.64.73]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 55.77 ms<br />
--> Connecting to cvsup5.us.freebsd.org [208.83.20.166]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 36.99 ms<br />
--> Connecting to cvsup6.us.freebsd.org [64.202.113.190]...<br />
    * error: connect: Invalid argument<br />
--> Connecting to cvsup7.us.freebsd.org [64.215.216.140]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 26.64 ms<br />
--> Connecting to cvsup8.us.freebsd.org [216.165.129.134]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 6.23 ms<br />
--> Connecting to cvsup9.us.freebsd.org [128.205.32.21]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 26.28 ms<br />
--> Connecting to cvsup10.us.freebsd.org [69.147.83.48]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 54.01 ms<br />
--> Connecting to cvsup11.us.freebsd.org [63.87.62.77]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 35.11 ms<br />
--> Connecting to cvsup12.us.freebsd.org [128.205.32.24]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 26.86 ms<br />
--> Connecting to cvsup13.us.freebsd.org [128.205.32.24]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 26.54 ms<br />
--> Connecting to cvsup14.us.freebsd.org [216.87.78.137]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 34.63 ms<br />
--> Connecting to cvsup15.us.freebsd.org [35.9.37.225]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 23.49 ms<br />
--> Connecting to cvsup16.us.freebsd.org [128.143.108.35]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 23.47 ms<br />
--> Connecting to cvsup17.us.freebsd.org [65.212.71.21]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 35.93 ms<br />
--> Connecting to cvsup18.us.freebsd.org [128.205.32.84]...<br />
    - server replied: OK 17 0 SNAP_16_1h CVSup server ready<br />
    - time taken: 3026.06 ms</p>
<p>>>  Speed Daemons:<br />
    - 1st: cvsup8.us.freebsd.org    6.23 ms<br />
    - 2st: cvsup16.us.freebsd.org   23.47 ms<br />
    - 3st: cvsup15.us.freebsd.org   23.49 ms<br />
[root@R34 /usr/ports/sysutils/fastest_cvsup]#<br />
</code></p>
<p>Cvsup8 it is!</p>
<p>So now, let&#8217;s get our ports-supfile in place&#8230;</p>
<p><code><br />
cp /usr/share/examples/cvsup/ports-supfile /root/<br />
</code></p>
<p>Now edit /root/ports-supfile and look for the following line&#8230;</p>
<p><code>*default host=CHANGE_THIS.FreeBSD.org</code></p>
<p>And modify it to read&#8230;<br />
<code>*default host=csup8.freebsd.org</code></p>
<p>Now, run the following to get *everything* up to date&#8230;</p>
<p><code><br />
cvsup -g -L 2 /root/ports-supfile<br />
</code></p>
<p>Voila, you have an updated ports tree. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/updating-the-freebsd-ports-tree-easily/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->