2008-07-04

Using rsync and ssh to copy music from iPhone to iTunes

I wanted to copy my music library from my iPhone to my PC at the office. iTunes make it easy to sync files from your PC to the iPhone, but not from the iPhone to a second PC, so most people resort to file copying. Smart people use rsync for efficient synchronization between multiple file systems, so I thought I'd give it a try. Here's how I did the same to sync the iPhone to the PC.

First, both computers must have rsync and ssh installed. I use a jailbreaked iPhone, with rsync and ssh installed through Cydia. My PC runs Windows XP, with rsync and ssh installed through Cygwin.

On the PC, I opened a Cygwin bash console and typed the rsync-over-ssh command. I typed my iPhone root password at the prompt, and watched until it finished copying all the music files:
richard@richard ~
$ rsync -e ssh -r --progress root@192.168.2.106:/var/mobile/Media/iTunes_Control/Music "/cygdrive/c/Documents and Settings/richard/My Documents/My Music/mirex"
root@192.168.2.106's password:
receiving file list ...
848 files to consider
Music/F00/ABBR.mp3
4733652 100% 5.27MB/s 0:00:00 (xfer#1, to-check=845/848)
Music/F00/AGWS.mp3
6498462 100% 7.29MB/s 0:00:00 (xfer#2, to-check=844/848)
Music/F00/BEIE.mp3
...
4724362 100% 559.84kB/s 0:00:08 (xfer#833, to-check=0/848)

sent 7276198 bytes received 974657842 bytes 393639.62 bytes/sec
total size is 3559603155 speedup is 3.63

richard@richard ~
$
In iTunes, I clicked File / Add a Folder and added My Documents/My Music/mirex. I waited a few minutes for iTunes to import the music files, and everything was ready to play.

There are at least two advantages to this approach:
  • rsync-over-ssh is faster than Windows file copy or scp because it skips files already exist on the PC.
  • This is completely wireless. You don't have to cable the iPhone to the PC.

No comments:

LinkWithin

Related Posts with Thumbnails