projects
/
android-command-line.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b76c534
)
incremental pull of new media files
master
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 8 Jul 2014 11:54:47 +0000
(13:54 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 8 Jul 2014 11:54:47 +0000
(13:54 +0200)
adb-dcim.sh
patch
|
blob
|
history
diff --git
a/adb-dcim.sh
b/adb-dcim.sh
index
07ef4b4
..
426fc05
100755
(executable)
--- a/
adb-dcim.sh
+++ b/
adb-dcim.sh
@@
-1,4
+1,10
@@
#!/bin/sh -x
#!/bin/sh -x
-mkdir /tmp/DCIM
-adb pull /sdcard/DCIM /tmp/DCIM/
+sdcard=/sdcard/DCIM/Camera/
+to=/data/DCIM/Camera/
+
+adb shell find $sdcard -mindepth 1 -maxdepth 1 | sed "s!$sdcard/*!!" | tr -d '\r' | sort > /tmp/dcim.android
+test -d $to || mkdir $to
+find $to -mindepth 1 -maxdepth 1 | sed "s!$to!!" | sort > /tmp/dcim.disk
+diff -uw /tmp/dcim.android /tmp/dcim.disk | grep -- "^-" | sed 's/^-//' | \
+xargs -i sh -xc "adb pull $sdcard/{} $to/{}"