On Fri, Oct 6, 2017 at 5:53 PM, ToddAndMargo <[email protected]> wrote:
> I would like to write a backup program to backup up
> my wife's files.
>
> Question: how do I access mtp://[usb:002,010] from
> both the command line and from Perl 6?
>
No MTP support module for Perl 6 as yet. There's a suite of command line
utilities, but they're *fugly*. (The package is called mtp-tools on
debian-derived systems; I don't know what rhel/fedora call it.)
Use 'mtp-files' to get a listing of files and their ids, and then
'mtp-getfile' to copy a file by its id (not name, at least not in the
version of mtp-tools I have). So to grab a backup settings file from my old
phone (whose mtp implementation doesn't work with current linux file
managers that speak mtp) I ended up doing:
mtp-files >5x.txt
grep -B1 -F k9s 5x.txt
(this reported file id 4325 for the settings file)
mtp-getfile 4325 settings.k9s
(this retrieves file 4325 and saves it locally as settings.k9s)
You may need to use mtp-connect to discover the tablet and find out what
settings are needed to make it the default device for mtp operations.
--
brandon s allbery kf8nh sine nomine associates
[email protected] [email protected]
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net