Thursday, October 01, 2009

Retrieve Nokia N70 files (pictures) on linux (or any obex compatible phone)


Easy as 1,2,3 :)

Follow the steps here to set it up first. Then use this simple script to get all your pictures, modify it as you wish or need.




 1 #!/bin/bash

 2

 3 date=`date +"%F"`

 4 tmp="/tmp/tmp"

 5 imagesDir="E:\Images" #Change this to your phone settings

 6 baseDir="/path/to/your/dir/$date"

 7

 8

 9 mkdir "$baseDir"

10

11 obexftp -u 1 -c $imagesDir -l > $tmp

12 dirs=`cat $tmp | sed 's/<folder name=\"\([0-9]*\)" modified=\"*\".*/\1/g' | sed 's/<.*$//g' | sed 's/\[//g' | tr "\n" " " 2> /dev/null`

13

14 for i in $dirs; do

15

16         obexftp -u 1 -c "$imagesDir/$i" -l > $tmp

17         files=`cat $tmp | sed 's/<file name=\"\(.*\)\" s.*/\1/g' | sed 's/<.*$//g' | sed 's/\[//g' | tr "\n" " " 2> /dev/null`

18

19         for j in $files; do

20                 echo ">>$j"

21                 obexftp -u 1 -c "$imagesDir/$i" -G "$j"

22                 mv "$j" "$baseDir"

23

24

25         done

26 done

27

28

29

30 gthumb "$baseDir"



Blogger templates

A cœur vaillant rien d'impossible.
Powered by Blogger.

Labels

About