<?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>TwiPhone.com &#187; rsync</title>
	<atom:link href="http://www.twiphone.com/tag/rsync/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.twiphone.com</link>
	<description>Tweaks for the iPhone</description>
	<lastBuildDate>Thu, 06 May 2010 13:58:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>How to backup your iPhone regularly via SSH using rsync (Updated)</title>
		<link>http://www.twiphone.com/2008/08/08/how-to-backup-your-iphone-regularly-via-ssh-using-rsync/</link>
		<comments>http://www.twiphone.com/2008/08/08/how-to-backup-your-iphone-regularly-via-ssh-using-rsync/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 12:33:58 +0000</pubDate>
		<dc:creator>TwiPhone</dc:creator>
				<category><![CDATA[Firmware]]></category>
		<category><![CDATA[Firmware 1.x]]></category>
		<category><![CDATA[Firmware 2.x]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone 2G]]></category>
		<category><![CDATA[iPhone 3G]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.twiphone.com/?p=69</guid>
		<description><![CDATA[Your SSH server on the iPhone is already set up. Now you want to make sure you get all the files from you iPhone backed up? You plan to change a few files on you iPhone and want to make sure you can revert to the original files? iTunes will not backup all neccessary files. [...]]]></description>
			<content:encoded><![CDATA[<p>Your SSH server on the iPhone is already set up. Now you want to make sure you get all the files from you iPhone backed up? You plan to change a few files on you iPhone and want to make sure you can revert to the original files?</p>
<p>iTunes will <strong>not</strong> backup all neccessary files. And even if it did backup your specific file, it is not that easy to get the specic file out of an iTunes backup. (I will give you a post how to extract files from iTunes backup files tomorrow.)</p>
<p>So my advice is to copy all files from your iPhone to your computer. Its quite simple!</p>
<p><span id="more-69"></span></p>
<p>You need a backup directory on your computer, i used &#8220;<em>iPhone-Backup</em>&#8221; in my home directory for this example.</p>
<p>(1) Make sure your computer and your iPhone are connected to the same WiFi network and you know the bonjour name or the IP-address of your iPhone. </p>
<p>(2) Make sure the iPhone <strong>auto-lock</strong> is set to off: Go to the iPhone &#8220;Settings&#8221;: Then to &#8220;General&#8221;, then &#8220;Auto-Lock&#8221; and choose &#8220;Never&#8221;. You can change this after backup but now you want to make sure the WiFi connection stays on while the backup runs.</p>
<p>(3) Open the Terminal.app on your computer</p>
<p>(4) Make sure you got the backup directory in your home folder already set up. If not, just type: <code>mkdir ~/iPhone-Backup</code></p>
<p>(5) For the backup (and for all subsequent backups later) type in: <code>rsync --exclude private/var/mobile/Media/iTunes_Control/ -av root@(your-iPhone-IP):/ ~/iPhone-Backup/ --delete</code></p>
<p>So if your iPhone address is 10.0.1.3 the command would look like this: <code>rsync --exclude private/var/mobile/Media/iTunes_Control/ -av root@10.0.1.3:/ ~/iPhone-Backup/ --delete</code></p>
<p>Now you got to wait a little. An iPhone running on firmware 2.x will probably take a few minutes for the first backup. Without applications the copy folder should be about 600 MB. </p>
<p>What does the command actually do?</p>
<p>(a) <code>rsync</code> will copy files via SSH from the SSH-server account root folder (<code>root@10.0.1.3:/</code>) to the local folder (<code>~/iPhone-Backup/</code>) that are not already copied. So the first backup will take quite a long time, all next backups will only copy new or changed files.</p>
<p>(b) the copy will exclude all files in your iPhones &#8220;iTunes Media&#8221; folder. (actually all files starting with <code>private/var/mobile/Media/iTunes_Control/</code>) This is neccessary since all your synced music and fotos from iTunes are stored here. Otherwise you would get a backup of all this data already stored in your iTunes!</p>
<p>(c) The &#8220;<code>--delete</code>&#8221; tag at the end makes sure all files already backup up and not on the iPhone anymore will be deleted with the next backup. So if you delete e.g. some camera pictures on your iPhone, the backup pictures on your computer will be deleted as well with the next backup.</p>
<p>(d) The &#8220;<code>-av</code>&#8221; tag specifies the backup mode: Archiving (a) and verbose (v). In verbose mode you get a long list of files that were backup up. There will be some files that cannot be backed up: Some of them are only links to devices on the phone. And some are part of running processes on the iPhone, e.g. your temporary mail file. Do not worry too much about them. You could change &#8220;<code>-av</code>&#8221; to &#8220;<code>-a</code>&#8221; and avoid the long list at all after your backup is set up correctly.</p>
<p><strong>A little correction:</strong></p>
<p>The Photo database <strong>will</strong> be copied: It is in <code>~/Media/Photos/</code>  So the correct syntax for <strong>not</strong> copying the photo database would be: <code>rsync --exclude private/var/mobile/Media/Photos/ --exclude private/var/mobile/Media/iTunes_Control/ -av root@10.0.1.3:/ ~/iPhone-Backup/ --delete</code></p>
<p>Hint: You can exclude any other folders &#8211; as long as you add an <code>--exclude</code> before any of them. Listing them after the <code>--exclude</code> command (space or comma separated) will not work!</p>
<p>
    
    
<script type="text/javascript"><!--
google_ad_client = "pub-1698934201924818";
/* iPhone-468x60 */
google_ad_slot = "2448863691";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>




</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twiphone.com/2008/08/08/how-to-backup-your-iphone-regularly-via-ssh-using-rsync/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>
