X-Git-Url: http://git.rot13.org/?p=android-command-line.git;a=blobdiff_plain;f=adb-pull-clockworkmod-backup.sh;h=d201ff3517982a2c78a82d361765542905cce8c6;hp=4ef4e600e37659fdf4eae83ce35f09ccf976e957;hb=HEAD;hpb=e4622c51149a896e464a234c90b00f94c63af7f1 diff --git a/adb-pull-clockworkmod-backup.sh b/adb-pull-clockworkmod-backup.sh index 4ef4e60..d201ff3 100755 --- a/adb-pull-clockworkmod-backup.sh +++ b/adb-pull-clockworkmod-backup.sh @@ -1,3 +1,9 @@ #!/bin/sh -x -adb pull /sdcard/clockworkmod/backup backup +sdcard=/sdcard/clockworkmod/ + +adb shell find $sdcard/backup/ -mindepth 1 -maxdepth 1 | sed "s!$sdcard/*!!" | tr -d '\r' > /tmp/backup.android +test -d backup || mkdir backup +find backup/ -mindepth 1 -maxdepth 1 -type d | sed 's!backup/!!' > /tmp/backup.disk +diff -uw /tmp/backup.android /tmp/backup.disk | grep -- '^-backup' | sed 's/^-//' | \ +xargs -i sh -xc "mkdir {} && adb pull $sdcard/{} {}"