If I use
adb push mydir/ /sdcard/Documents/
the result is as expected: all files from within mydir/
end up inside /sdcard/Documents/
(just the permissions are not kept, even not when using -a
; on the internal sdcard everything is turned into 0660
while on the external sdcard everything is set to 0771
– which might be a limitation of sdcardfs as not even chmod 0764
on the device has any effect). But the other direction is weird: using
adb pull /sdcard/Documents/ mydir/
results in the files showing up inside mydir/Documents/
, which is rather very unexpected. I've played with all combinations of trailing slashes (including without any trailing slashes), no dice. Even tried different versions of adb
(thinking the one used might have a bug). Same happens when using the external sdcard, so it's not the symlink (/sdcard -> /storage/self/primary
) fooling it.
So any clue what could be wrong here? When I search on the net, all findings suggest it should work as I expect, but it somehow does not. How would I need to adjust above adb pull
command so all files from inside /sdcard/Documents/
show up locally inside mydir/
, but not the Documents/
directory itself as subdir? And: How to keep permissions as they are?
/data
(say,/data/data/mybackups
).adb shell "tar -ch sdcard | gzip" > sdcard_backup.tar.gz
rsync
;)