Since switching to ubuntu ive been trying to find the best way to backup my phone book and calendar in Ubuntu. Ive tried various software sync solutions and none really worked the way i needed them to. Then i found obex, and through this post i found out a bit more Sony Ericsson specific information.


The tools
you will need to install obexftp to transfer files to and from your mobile. 

sudo apt-get install obexftp 

also i use the USB cable that came with my phone, but i will also show you how to use bluetooth if you dont have the cable, or just prefer wireless


backing up address book and calendar
Your address book and calendar are located at telecom/pb.vcf and telecom/cal.vcs respectivly this page is useful for finding out where various files are. so to backup these files open up a terminal window and enter the following

cd ~/Desktop;
   sudo obexftp -v -u 0 -U synch -S -g telecom/cal.vcs;
   sudo obexftp -v -u 0 -U synch -S -g telecom/pb.vcf;

the above method assumes you have your phone plugged in via USB, however if you wish to use bluetooth, enter the following, replacing PHONE_NAME with your phone's bluetooth name

cd ~/Desktop;
   sudo obexftp -v -b PHONE_NAME -U synch -S -g telecom/cal.vcs;
   sudo obexftp -v -b PHONE_NAME -U synch -S -g telecom/pb.vcf;

So whichever method you used you should now have 2 files on your desktop which you can backup to an external device.


Exploring your phone
So, i also wanted to backup all my photos from my phone, but first i needed to find out where they are. using obex you can list directory structures like this: 

sudo obexftp -u 0 -l /

This will list the root directory of your phone, obex returns an xml file of the directory structure. using the same method i listed my Memory Stick which showed up when i listed the root directory.

sudo obexftp -u 0 -l /Memory Stick/

The name of your storage device may vary so check your xml listing and replace Memory Stick if necessary. I searched around and found my photos where at /Memory Stick/DCIM/100MSDCF/


Backing up multiple files
To backup photos taken with my phone's camera requires a bit more effort. When you ask for a directory listing through obex it returns an xml file with all the files in the current directory. When you want to download files you can only do it one at a time, so using the file list given by the xml i used grep sed and awk to make a nice list of files, then xargs to loop through the list and transfer all the files:

cd ~/Pictures;
   sudo obexftp -u 0 -l /Memory Stick/DCIM/100MSDCF/ | grep "file name" | awk '{print $2}' | sed -e 's/name="//g;s/"$//g' | xargs sudo obexftp -u 0 -g /Memory Stick/DCIM/100MSDCF/{}

And so now i have my phone book, calendar and photos backed up to my computer.

k610i Phone book and Calendar backup in ubuntu Thu, 10th Apr 2008

Since switching to ubuntu ive been trying to find the best way to backup my phone book and calendar in Ubuntu. Ive tried various software sync solutions and none really worked the way i needed them to. Then i found obex, and through this post i found out a bit more Sony Ericsson specific information.

The tools

you will need to install obexftp to transfer files to and from your mobile.

sudo apt-get install obexftp

also i use the USB cable that came with my phone, but i will also show you how to use bluetooth if you dont have the cable, or just prefer wireless

backing up address book and calendar

Your address book and calendar are located at telecom/pb.vcf and telecom/cal.vcs respectivly this page is useful for finding out where various files are. so to backup these files open up a terminal window and enter the following

cd ~/Desktop; sudo obexftp -v -u 0 -U synch -S -g telecom/cal.vcs; sudo obexftp -v -u 0 -U synch -S -g telecom/pb.vcf;

the above method assumes you have your phone plugged in via USB, however if you wish to use bluetooth, enter the following, replacing PHONE_NAME with your phone's bluetooth name

cd ~/Desktop; sudo obexftp -v -b PHONE_NAME -U synch -S -g telecom/cal.vcs; sudo obexftp -v -b PHONE_NAME -U synch -S -g telecom/pb.vcf;

So whichever method you used you should now have 2 files on your desktop which you can backup to an external device.

Exploring your phone

So, i also wanted to backup all my photos from my phone, but first i needed to find out where they are. using obex you can list directory structures like this:

sudo obexftp -u 0 -l /

This will list the root directory of your phone, obex returns an xml file of the directory structure. using the same method i listed my Memory Stick which showed up when i listed the root directory.

sudo obexftp -u 0 -l /Memory Stick/

The name of your storage device may vary so check your xml listing and replace Memory Stick if necessary. I searched around and found my photos where at /Memory Stick/DCIM/100MSDCF/

Backing up multiple files

To backup photos taken with my phone's camera requires a bit more effort. When you ask for a directory listing through obex it returns an xml file with all the files in the current directory. When you want to download files you can only do it one at a time, so using the file list given by the xml i used grep sed and awk to make a nice list of files, then xargs to loop through the list and transfer all the files:

cd ~/Pictures; sudo obexftp -u 0 -l /Memory Stick/DCIM/100MSDCF/ | grep "file name" | awk '{print $2}' | sed -e 's/name="//g;s/"$//g' | xargs sudo obexftp -u 0 -g /Memory Stick/DCIM/100MSDCF/{}

And so now i have my phone book, calendar and photos backed up to my computer.

Posted in : , ,