<?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>tolaris.com &#187; bacula</title>
	<atom:link href="http://www.tolaris.com/tag/bacula/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tolaris.com</link>
	<description>When the going gets tough, the tough sniff packets.</description>
	<lastBuildDate>Tue, 24 Jan 2012 17:47:01 +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>Replacing Bacula with BackupPC</title>
		<link>http://www.tolaris.com/2009/10/08/replacing-bacula-with-backuppc/</link>
		<comments>http://www.tolaris.com/2009/10/08/replacing-bacula-with-backuppc/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 22:26:42 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[backuppc]]></category>
		<category><![CDATA[bacula]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=456</guid>
		<description><![CDATA[We recently moved our primary backup machine to another location, and have overhauled a lot of our network infrastructure. This meant a lot of work updating the Bacula configurations on those machines. I&#8217;ve been unhappy with Bacula for some time, so I replaced it with BackupPC. Bacula is very complicated. That complication provides flexibility &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>We recently moved our primary backup machine to another location, and have overhauled a lot of our network infrastructure.  This meant a lot of work updating the <a href="http://www.bacula.org/">Bacula</a> configurations on those machines.  I&#8217;ve been unhappy with Bacula for some time, so I replaced it with <a href="http://backuppc.sourceforge.net/">BackupPC</a>.</p>
<p><span id="more-456"></span>Bacula is very complicated.  That complication provides flexibility &#8211; if you want your level-0 backups to run on Tuesdays at 1900 and Thursdays at 22:30, and to exclude some files on Wednesdays only, it can &#8211; but it also makes it brittle.  One daemon hangs for any reason, and half the backups never complete.  It scales well to very large enterprise sizes, but I don&#8217;t really need that yet.</p>
<p>What Bacula does really well is dump data to tape.  I don&#8217;t use tape.  I use a RAID array.  When you dump data to tape, you do it in series.  But when you dump data to disk, you can just as easily do it in parallel.  The process of calculating checksums and compressing files limits the rate at which you actually transfer those files to the backup store.  With most of my servers, that turns out to be about 20 mbit/sec at max.  But my servers are typically connected via gigabit LAN, so why not backup several at the same time?  Further, my backup window is limited to 12 hours at night so as to avoid affecting normal traffic during the day.  If you are running backups in series and one takes 4 hours, the other backups run the risk of pushing into the morning work hours.</p>
<p>How to install and configure BackupPC is already well documented <a href="http://www.howtoforge.com/linux_backuppc">elsewhere</a>.  Where my install differs is that we don&#8217;t run Windows, so we don&#8217;t have to deal with backing it up.  All of my defaults are configured to use rsync and expect Linux filesystems.</p>
<p>What BackupPC does really well is just back stuff up, to disk, whenever it can.  It is possible to force exactly when backups run, but in general the system isn&#8217;t designed that way.  I tried to force everything to kick off at 20:00 UTC nightly, and run until finished.  But by default, BackupPC is configured to try to backup every hour on the hour, and to run the next backup 24 hours after the last one finished.  I soon realised that it was best to do it that way.  When a server is down or the backup fails, BackupPC tries again every hour until it succeeds.  That is far more robust than &#8220;the backup failed last night, so we have to wait until next night&#8221;.</p>
<p>So what about not running backups during the day?  It can do that too.  You can specify exactly which hours to wake up and perform pending jobs:</p>
<pre>$Conf{WakeupSchedule} = [ '19', '20', '21', '22', '23', '0', '1', '2', '3', '4', '5', '6' ];</pre>
<p>But a better way is to run every hour anyway, and instead use blackout periods:</p>
<pre>$Conf{WakeupSchedule} = [ '12', '13', '14', '15', '16',
'17', '18', '19', '20', '21', '22', '23', '0', '1',
'2', '3', '4', '5', '6', '7', '8', '9', '10', '11' ];

$Conf{BlackoutBadPingLimit} = '3';
$Conf{BlackoutGoodCnt} = '7';
$Conf{BlackoutPeriods} = [ {
    'weekDays' => [ '0', '1', '2', '3', '4', '5', '6' ],
    'hourBegin' => '6.5'
    'hourEnd' => '18.5',
  } ];</pre>
<p>Now jobs run every hour.  But for any host that has stayed online for 7 days (tested by ping, where 3 are sent before declaring failure), backups will not start between 6:30 and 18:30.  Unfortunately all times are hours, so you must use decimal HH.HH instead of HH:MM.  You&#8217;ll only make a few mistakes before you get used to it.</p>
<p>The advantage to the blackout system is that it backs up a recently failed server within an hour of it coming online again, even during the day, while restricting backups of functioning servers to the later hours.  Servers just added to the system may also back up during the day because they don&#8217;t have 7 good pings yet.  The easy solution is to add new servers at night.  Backups tend to stay near to when they last ran, but can move within the normal job period.</p>
<p>While backup times can move around, every server is still backed up every 24 hours, at some point during the night.  Now that I&#8217;ve run this for 5 weeks, on 47 servers, I&#8217;m very pleased with it.  It has proven more reliable than Bacula, and the disk usage is far, far better.  BackupPC compresses and pools stored files, and uses hashes to determine if a file needs to be archived again.  If you have multiple copies of the same file, across all servers, you only have one on disk on the BackupPC server.  Backing up every copy of /usr/ suddenly makes no difference at all.  From the web interface:</p>
<pre>There are 47 hosts that have been backed up, for a total of:
    * 177 full backups of total size 1331.97GB (prior to pooling and compression),
    * 395 incr backups of total size 783.92GB (prior to pooling and compression).

Pool is 337.28GB comprising 4081543 files and 4369 directories (as of 2009-10-08 13:46),
Pool hashing gives 543 repeated files with longest chain 21,
Nightly cleanup removed 63257 files of size 37.75GB (around 2009-10-08 13:46),
Pool file system was recently at 29% (2009-10-08 21:25), today's max is 29% (2009-10-08 12:00)
and yesterday's max was 29%. </pre>
<div id="attachment_536" class="wp-caption alignnone" style="width: 697px"><a href="http://www.tolaris.com/blog/wp-content/uploads/2009/10/backuppc-pool.png"><img src="http://www.tolaris.com/blog/wp-content/uploads/2009/10/backuppc-pool.png" alt="BackupPC pool statistics" title="BackupPC pool statistics" width="687" height="185" class="size-full wp-image-536" /></a><p class="wp-caption-text">BackupPC pool statistics</p></div>
<p>That&#8217;s 5 weeks of weekly level-zeroes plus the last 14 daily incrementals.  The same data in Bacula for only 27 servers came to 900 GB.  BackupPC is configured to keep backups going back 5 months; at best I could only manage a month of Bacula backups for the same period.</p>
<p>What about data throughput?  Bacula topped out at about 20 mbit for even gigabit-connected hosts, and it could only run in serial (unless I configured multiple &#8220;storage devices&#8221; (directories), but there is no way to pool them for dynamic use.  Allowing only 3 simultaneous backups, the server routinely exceeds 60 mbit of traffic during the first hour of the run.</p>
<div id="attachment_525" class="wp-caption alignnone" style="width: 613px"><a href="http://www.tolaris.com/blog/wp-content/uploads/2009/10/backup.png"><img src="http://www.tolaris.com/blog/wp-content/uploads/2009/10/backup.png" alt="Network statistics" title="Network statistics" width="603" height="304" class="size-full wp-image-525" /></a><p class="wp-caption-text">Network statistics</p></div>
<p>Unfortunately I don&#8217;t have useful Cacti graphs from the time we ran Bacula, but it was at best 80% as fast for only one backup.  And of course it could run only one.</p>
<p>What else does BackupPC have over Bacula?</p>
<ul>
<li>A good web interface.  Yes, webacula exists, but you are still limited to editing config files and using an interactive terminal interface to do anything useful.  With BackupPC you can use any standards-compliant browser to review statistics and logs about recent backups, edit the config, browse backups in tree format and restore from them, and start additional backups outside of the normal schedule.  You can also grant users the ability to browse and schedule backups for specific servers or desktops, but not see any others.</li>
<li>Inline help.  When editing BackupPC&#8217;s config in the web GUI, all configuration variables are hyperlinks to the HTML documentation.</li>
<li>Several ways to restore.  You can directly restore file to the server by the same transport that you use to backup (rsync, ssh+tar, SMB).  You can also download a ZIP or tar.gz through your browser.</li>
<li>No database dependency.  The filesystem is the database.  Files are stored in disk trees, and logs are text on disk.  I&#8217;m not against using MySQL, but it adds one more point of failure.</li>
<li>No client daemon.  That&#8217;s right, nothing to install on the clients.  Just add the server&#8217;s SSH key to your root user, and rsync does the rest.  If you think that&#8217;s a security risk, it is.  Any other backup system has the same vulnerability.  I suggest using <a href="http://www.tolaris.com/2009/09/05/using-ssh-agent-and-setting-key-access-limits/">key access limits</a>.</li>
</ul>
<p>I&#8217;ve tested basic restores and bare-metal ones.  So far there are no issues with BackupPC, and I&#8217;m much happier using it.  It is simpler, less prone to failure, and less likely to require user intervention.  It may not scale to 100 distributed backup stores with tape drives, but it is excellent for the small-to-medium enterprise.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2009/10/08/replacing-bacula-with-backuppc/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>It has been *0* days since the last &#8216;rm -rf *&#8217;</title>
		<link>http://www.tolaris.com/2009/02/06/it-has-been-0-days-since-the-last-rm-rf/</link>
		<comments>http://www.tolaris.com/2009/02/06/it-has-been-0-days-since-the-last-rm-rf/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 16:52:47 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bacula]]></category>
		<category><![CDATA[facepalm]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=214</guid>
		<description><![CDATA[Sometimes running Bacula is a real pain. It&#8217;s too much infrastructure for someone who doesn&#8217;t use tape backups (we just use a big RAID store). But today it saved me. It all began when I accidentally copied /home/tyler/bin on my laptop to another workstation&#8217;s /bin. I have a lot of little scripts and doodads for [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes running <a href="http://www.bacula.org">Bacula</a> is a real pain.  It&#8217;s too much infrastructure for someone who doesn&#8217;t use tape backups (we just use a big RAID store).  But today it saved me.</p>
<p>It all began when I accidentally copied /home/tyler/bin on my laptop to another workstation&#8217;s /bin.  I have a lot of little scripts and doodads for my personal use in /home/tyler/bin, but none of them are named for real executables in /bin.  So I think, &#8220;No big deal, just manually remove those scripts from /bin and no harm done.&#8221;</p>
<p><span id="more-214"></span>So I quickly listed the programs in bin, copied and pasted them into the other terminal with &#8216;rm&#8217;, and let fly.</p>
<p>Wait, was that /bin or /home/tyler/bin I just listed?  Oh shit.</p>
<pre>root@boned-workstation:/bin#
ls
bash: ls: command not found</pre>
<p>When you&#8217;ve just deleted /bin, you&#8217;re screwed.  You can&#8217;t do anything.  Quickly rsync replacements over?  Nope.  How about a tarball?  Nope.  In fact you probably cannot even login, so don&#8217;t logout of the SSH session you&#8217;ve still got open. Booting from a Live CD/USB/DVD is about your only hope.</p>
<p>And then I remembered Bacula.  The Bacula file daemon needs only itself to do its job, and it doesn&#8217;t even need that once the daemon is running.  You could delete /usr/sbin/bacula-fd and it will still work unless you stop the daemon.</p>
<p>We don&#8217;t back up system files on workstations, just user files and the dpkg database.  But Ubuntu workstations and servers run the same software.  So I restored the previous night&#8217;s backup of /bin/ from the backup server itself to the affected workstation.  Bacula&#8217;s restore process is quite flexible, and is happy to let you restore from any archive to any host it knows.</p>
<p>A quick rsync from a similar workstation to make sure all the binaries are there, and we&#8217;re saved!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2009/02/06/it-has-been-0-days-since-the-last-rm-rf/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

