<?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>brunotavares.net: ScrapBook &#187; backups</title>
	<atom:link href="https://blog.brunotavares.net/?feed=rss2&#038;tag=backups" rel="self" type="application/rss+xml" />
	<link>https://blog.brunotavares.net</link>
	<description>Notes. tech and a few thoughs</description>
	<lastBuildDate>Sun, 25 Nov 2018 17:59:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>&#8220;time-machine&#8221; &#8482; with rsync</title>
		<link>https://blog.brunotavares.net/?p=199</link>
		<comments>https://blog.brunotavares.net/?p=199#comments</comments>
		<pubDate>Tue, 23 Sep 2008 11:46:38 +0000</pubDate>
		<dc:creator>bat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.brunotavares.net/?p=199</guid>
		<description><![CDATA[The apple&#8217;s time-machine concept is precisely what i want for my laptop &#8220;backups&#8221; For the information sitting in my laptop i don&#8217;t want traditional disaster and recovery backups, i want to be able to, quickly, search and restore any version of ( virtually ) any file. Tthe problem? i don&#8217;t own a mac. The principle [...]]]></description>
				<content:encoded><![CDATA[<p>The apple&#8217;s time-machine concept is precisely what i want for my laptop &#8220;backups&#8221;</p>
<p>For the information sitting in my laptop i don&#8217;t want traditional disaster and recovery backups, i want to be able to, quickly, search and restore any version of ( virtually ) any file.</p>
<p>Tthe problem? i don&#8217;t own a mac.</p>
<p>The principle of the thing:</p>
<p>Incremental backup of all the files that changed in a short period of time ( let&#8217;s say 5 minutes, apple&#8217;s time machine does it every hour ).<br />
Create a snapshot of your laptop at the backup time, this implies being able to browse the laptop the exact same way that you browse your current file structure</p>
<p><strong>My current setup:</strong></p>
<pre><code>
BACKUPDIR="/backups"
DIRSTOBACKUP="/home /data"
date=`date "+%Y-%m-%dT%H:%M:%S"`
rsync -aP --exclude-from=~/backup.exceptions \
     --link-dest=$BACKUPDIR/current $BACKUPDIR/back-$date $DIRSTOBACKUP

cd $BACKUPDIR; rm -f current ;ln -s back-$date current
<code></pre>
<p>This rsync command line will backup all the files in DIRSTOBACKUP to $BACKUPDIR/back-$date .</p>
<p>The <code>-a</code> will ensure all the files are copied and their attributes preserved.</p>
<p><code>-P</code> justs add the ability to resume interrupted backups.</p>
<p><code>--link-dest </code>is really the core option. With this option, rsync will hard-link all the unchanged files to <code>--link-dest.</code> So, in you backup dir you'll end-up with all the changed files and bunch of hard-links to the unchanged files saving you a lot of storage space.</p>
<p>After that just updates the current symlink to the newest backup.</p>
<p>Now, in $BACKUP_DIR you have accurate snapshots of your laptop in all the backup times.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.brunotavares.net/?feed=rss2&#038;p=199</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
