android-file-transfer-linux
android-file-transfer-linux copied to clipboard
Error: invalid command when using --input-file
Hi,
I have created a script to upload files into Android, mainly music. The script has the following structure:
"cd Music" "put ./AC_DC/Back\ In\ Black/04\ Givin\ The\ Dog\ A\ Bone.mp3"
"cd Music" "put ./Dream\ Theater/2007\ -\ Falling\ Into\ Infinity\ Demos\ 1996-1997/Disc\ II/07\ -\ Speak\ To\ Me.mp3"
"cd Music" "put ./The\ Smiths/1986\ -\ The\ Queen\ Is\ Dead\ (Japan\ MiniLP\ WPCR-12441)/08\ -\ Vicar\ In\ A\ Tutu.mp3"
"cd Music" "put ./Zbigniew\ Preisner/When\ a\ Man\ Loves\ a\ Woman/08\ Dressing\ Casey.mp3"
"cd Music" "put ./Oasis/Be\ Here\ Now/01\ D'You\ Know\ What\ I\ Mean_.mp3"
"cd Music" "put ./The\ Kenny\ Wayne\ Shepherd\ Band/2011\ -\ How\ I\ Go\ (Special\ Edition)/06.\ Oh,\ Pretty\ Woman.mp3"
"cd Music" "put ./Two\ Steps\ From\ Hell/Ashes/05\ Crawlspace.mp3"
"cd Music" "put ./Mecano/Retitled/02\ Permanent\ Revolt.mp3"
"cd Music" "put ./Dire\ Straits/On\ Every\ Street/10\ My\ Parties.mp3"
"cd Music" "put ./Bruce\ Springsteen/Letter\ To\ You/02.\ Letter\ To\ You.mp3"
"cd Music" "put ./Das\ Ich/Lava-Feuer/08\ Seele\ tanzt.mp3"
"cd Music" "put ./The\ Real\ McKenzies/The\ Real\ McKenzies/02\ Loch\ Lomond.mp3"
"cd Music" "put ./Mono\ Inc/2017\ -\ Together\ Till\ The\ End/16\ -\ Children\ Of\ The\ Dark\ (Faderhead\ Remix).mp3"
When I call aft-mtp-cli --input-file <filename>
I get errors:
error: invalid command cd Music
However, if I copy-paste each line individually, the transfer is successful:
aft-mtp-cli "cd Music" "put ./Dire\ Straits/On\ Every\ Street/10\ My\ Parties.mp3"
I could not find any documentation on the proper use of --input-file
or how to properly format it
I think you don't have to cd
on every line, just do it once.
--input-file basically reopens stdin with your file, so it's synonymous to aft-mtp-cli < your-file
Thanks for the suggestions,
I still get the same errors...
Following your suggestion, now the script has the following structure
"cd Music"
"put /mnt/Multimedia/Musica/Gojira/2003\ -\ The\ Link\ (Re-Release\ -\ 2005)/11\ -\ Dawn.mp3"
"put /mnt/Multimedia/Musica/Gojira/2003\ -\ The\ Link\ (Re-Release\ -\ 2005)/05\ -\ Torii.mp3"
"put /mnt/Multimedia/Musica/Charles\ Trenet/Effroyables\ Jardins/13\ Y'a\ d'la\ joie.mp3"
"put /mnt/Multimedia/Musica/Mark\ Knopfler/Screenplaying/05\ The\ Long\ Road.mp3"
But I still get the same errors:
error: invalid command cd Music
error: invalid command put /mnt/Multimedia/Musica/Gojira/2003 - The Link (Re-Release - 2005)/11 - Dawn.mp3
error: invalid command put /mnt/Multimedia/Musica/Gojira/2003 - The Link (Re-Release - 2005)/05 - Torii.mp3
error: invalid command put /mnt/Multimedia/Musica/Charles Trenet/Effroyables Jardins/13 Y'a d'la joie.mp3
error: invalid command put /mnt/Multimedia/Musica/Mark Knopfler/Screenplaying/05 The Long Road.mp3