androidshelladb

how to adb pull folder with wildcard


Basically, I dump all data into the directory 'sdcard/2019-07-xx-xx and there are subdirectories in 2019-07-xx-xx. The Folder is named after the timestamp when dumping data, now I run the command:

adb pull '/sdcard/2019-07*'

but it prompted:

adb: error: failed to stat remote object 'sdcard/2019-07*': No such file or directory

who can help me out?


Solution

  • Example:

    for days in 0{1..9} 1{0..9} 2{0..9} 3{0..1}; do 
       adb shell echo "\$EXTERNAL_STORAGE/2019-07-$days/" 
    done
    

    Gives us below output:

    /sdcard/2019-07-01/
    /sdcard/2019-07-02/
    /sdcard/2019-07-03/
    /sdcard/2019-07-04/
    /sdcard/2019-07-05/
    ......
    

    Final: You can copy and paste

    - don't forget to change source_path and dates if needed - Notice the trial slash:

    for days in 0{1..9} 1{0..9} 2{0..9} 3{0..1}; do
       adb pull "\$EXTERNAL_STORAGE/2019-07-$days/" ~/source_path
    done