From: Dobrica Pavlinusic Date: Tue, 8 Jul 2014 11:54:47 +0000 (+0200) Subject: incremental pull of new media files X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=271f2eb44d163af24118a97f7d7d5c0dcaf6fd73;hp=b76c534c77236a8723d3b6e5bdf09f58f3ca88c6;p=android-command-line.git incremental pull of new media files --- diff --git a/adb-dcim.sh b/adb-dcim.sh index 07ef4b4..426fc05 100755 --- a/adb-dcim.sh +++ b/adb-dcim.sh @@ -1,4 +1,10 @@ #!/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/{}"