On 11/05/2015 01:01 AM, Jon Ingason wrote:
Den 2015-11-04 kl. 23:19, skrev Rick Stevens:
On 11/04/2015 01:53 PM, Jon Ingason wrote:
I want to make script that copy photos from Samsung Galaxy S6 Edge. I
can copy photos with the Filer but has not found a way to do this by
scripting.

Has someone any idea how to do this? Has done some search without
finding something that works.

You'll need something like simple-mtpfs (available from the repos) to
mount the phone/tablet as a disk drive, then navigate through that
mountpoint to find where the stuff is. I use it for my S5 phone.

 From that point on, it's up to you to do what you will.

My system is Gnome DT and "gvfs-mtp" is installed. I can see the phones
files in /run/user/1000/gvfs/mtp\:host\=%5Busb%3A001%2C008%5D/.
The problem I am having is that I can't use "cp -a
<path/to/files/on/phone> <path/to/dest>" or "rsync -av
<path/to/files/on/phone> <path/to/dest>". I can only use Gnome filer
manager to copy the file from the phone to the computer.

I have installed simple-mtpfs and tried to mount the phones file system
to local directory without success.

What is the problem? I can't see it :-)

First off, you need to see which devices MTP sees:

        [rick@prophead ~]$ simple-mtpfs -l
        1: SamsungGalaxy models (MTP)

In my case, just my Galaxy S5.

Next, make sure you have write privileges on the mountpoint you want. I
just created a mountpoint in my home directory for testing:

        [rick@prophead ~]$ mkdir tstmnt

Next, I mounted my phone there:

        [rick@prophead ~]$ simple-mtpfs --device 1 tstmnt

To verify it, I checked what's mounted (I've stripped out irrelevant
stuff from the following list):

        [rick@prophead ~]$ mount
        ...
simple-mtpfs on /home/rick/tstmnt type fuse.simple-mtpfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
        ...

And getting a listing of what's mounted there:

        [rick@prophead ~]$ ls -l tstmnt
        total 0
        drwxrwxr-x. 2 rick rick 0 Dec 31  1969 Card
        drwxrwxr-x. 2 rick rick 0 Dec 31  1969 Phone

So, there's a "Card" directory (the SD card in my phone) and a "Phone"
directory (the internal phone storage). I LOVE the fact that the dates
shown are pre-Unix epoch! Cute, eh? (For reference, the Unix epoch
started at 00:00:00.00, January 1, 1970 UTC). I thought Android was
Linux based. :-)

To unmount, just use the normal umount command, but you need to be root
to do it:

        [rick@prophead ~]$ sudo umount ~rick/tstmnt

Voila!

There are ways to make this happen automagically by buggering some udev
rules and such, but I've not done it.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ri...@alldigital.com -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-     Veni, Vidi, VISA:  I came, I saw, I did a little shopping.     -
----------------------------------------------------------------------
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org

Reply via email to