<?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>Cody Baker</title>
	<atom:link href="http://www.codybaker.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codybaker.org</link>
	<description>My Place to Publish</description>
	<lastBuildDate>Thu, 29 Mar 2012 03:52:49 +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>Efficiently Move rsnapshot Repository Between FuseCompress Volumes</title>
		<link>http://www.codybaker.org/2012/01/efficiently-move-rsnapshot-repository-between-fusecompress-volumes/</link>
		<comments>http://www.codybaker.org/2012/01/efficiently-move-rsnapshot-repository-between-fusecompress-volumes/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 07:28:48 +0000</pubDate>
		<dc:creator>cody</dc:creator>
				<category><![CDATA[System Admin]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[rsnapshot]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.codybaker.org/?p=15</guid>
		<description><![CDATA[As explained in my last post, I&#8217;m moving from a Fusecompress 2.0 backend to the more stable 0.9.x branch.  I&#8217;m using the following code to move the repository, incrementally (and in recoverable way).  The disk is too small to maintain &#8230; <a href="http://www.codybaker.org/2012/01/efficiently-move-rsnapshot-repository-between-fusecompress-volumes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As explained in my <a title="Verify Hardlink Integrity of RSnapshot Copy" href="http://www.codybaker.org/2011/12/verify-hardlink-integrity-of-rsnapshot-copy/">last post</a>, I&#8217;m moving from a Fusecompress 2.0 backend to the more stable 0.9.x branch.  I&#8217;m using the following code to move the repository, incrementally (and in recoverable way).  The disk is too small to maintain both copies at once.  Because the normal tools (mv/cp/rsync) work depth-first and daily.0 is nearly identical to daily.1 (and daily.2, etc.), only a small amount of space is freed after moving daily.0 and the disk eventually fills.</p>
<p>As with everything posted here, use this at your own risk and ALWAYS backup!</p>
<pre class="wp-code-highlight prettyprint">dest=/home/backup.new/snapshot
source=/home/backup/snapshot

# Create the directories
find . -type d -print0 | while read -r -d '' file
  do
  if test ! -d &quot;$dest/$file&quot;
    then
      mkdir -vp &quot;$dest/$file&quot;
      touch --reference=&quot;$file&quot; &quot;$dest/$file&quot;
      chown --reference=&quot;$file&quot; &quot;$dest/$file&quot;
  fi
done

# Move the files in, link any duplicates, and remove the original.
for ssnap in `ls $source`
  do
  cd $ssnap
  find . ! -type d -print0 | while read -r -d '' file
    do
    if test ! -e &quot;$dest/$ssnap/$file&quot; -o -h &quot;$dest/$ssnap/$file&quot;
      then
        cp -adnvp &quot;$file&quot; &quot;$dest/$ssnap/$file&quot;
      else
        echo &quot;$dest/$ssnap/$file&quot; exists.
    fi
    for dsnap in `ls $source`
      do
      if test &quot;$ssnap&quot; = &quot;$dsnap&quot;
        then continue
      fi
      echo &quot;Checking $dsnap - ../$dsnap/$file&quot;
        if test &quot;$file&quot; -ef &quot;../$dsnap/$file&quot;;
        then
          ln -v &quot;$dest/$ssnap/$file&quot; &quot;$dest/$dsnap/$file&quot;
          rm -vf &quot;../$dsnap/$file&quot;
        fi
    done
    rm -vf &quot;$file&quot;
  done
done</pre>
<p><strong>Updated 2012-01-03</strong>: Filenames/Directories names with new line character caused mischief. Fixed by null separating.  Also included symlinks, char devices, and other special filetypes in the transfer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codybaker.org/2012/01/efficiently-move-rsnapshot-repository-between-fusecompress-volumes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Verify Hardlink Integrity of RSnapshot Copy</title>
		<link>http://www.codybaker.org/2011/12/verify-hardlink-integrity-of-rsnapshot-copy/</link>
		<comments>http://www.codybaker.org/2011/12/verify-hardlink-integrity-of-rsnapshot-copy/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 18:17:08 +0000</pubDate>
		<dc:creator>cody</dc:creator>
				<category><![CDATA[System Admin]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[rsnapshot]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.codybaker.org/?p=6</guid>
		<description><![CDATA[I use fusecompress as a backing file system for rsnapshot. Unfortunately I&#8217;ve been having crashes with the 2.0 C++ fork, so I&#8217;ve tried converting back to the 0.9.x C implementation. That&#8217;s been a tricky process because my disks are only &#8230; <a href="http://www.codybaker.org/2011/12/verify-hardlink-integrity-of-rsnapshot-copy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I use fusecompress as a backing file system for <a title="rsnapshot" href="http://rsnapshot.org/" target="_blank">rsnapshot</a>. Unfortunately I&#8217;ve been having crashes with the <a href="http://miio.net/wordpress/projects/fusecompress/">2.0 C++ fork</a>, so I&#8217;ve tried converting back to the <a href="http://code.google.com/p/fusecompress/">0.9.x C implementation</a>. That&#8217;s been a tricky process because my disks are only just a bit too small for two concurrent copies of the rsnapshot tree. I&#8217;ve been using rsync to duplicate the tree, but because of the disk overfill it&#8217;s failed a few times. RSnapshot uses hard links to deduplicate files between snapshots (daily.0, daily.1, etc). Since rsync had failed a few times I wasn&#8217;t sure that it would maintain hard links consistently between the yet to sync&#8217;ed portion and the previously sync&#8217;ed portion after being restarted.  This script compares the hardlink structure between the two disk stores and generates a script to remedy any inconsistencies.  That said, rsync seems to behave properly because the script found no inconsistencies.</p>
<pre class="wp-code-highlight prettyprint">find . -type f | while read file
  do if (test &quot;$file&quot; -ef &quot;../daily.2/$file&quot;);
    then
      if ! (test &quot;/home/backup.new.fusecompress.backing/snapshot/daily.1/$file&quot; -ef &quot;/home/backup.new.fusecompress.backing/snapshot/daily.2/$file&quot;)
      then
        echo rm -f &quot;/home/backup.new.fusecompress.backing/snapshot/daily.2/$file&quot; &amp;gt;&amp;gt; /root/linked.daily.1
        echo ln &quot;/home/backup.new.fusecompress.backing/snapshot/daily.1/$file&quot; &quot;/home/backup.new.fusecompress.backing/snapshot/daily.2/$file&quot; &amp;gt;&amp;gt; /root/linked.daily.1
    fi
  fi
done</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.codybaker.org/2011/12/verify-hardlink-integrity-of-rsnapshot-copy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

