pull backup incrementaly
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 1 Oct 2010 17:04:10 +0000 (19:04 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 1 Oct 2010 17:04:10 +0000 (19:04 +0200)
it's more or less a mess of ls, diff and xargs to pull just new
files using adb

adb-pull-clockworkmod-backup.sh

index 4ef4e60..ae5008c 100755 (executable)
@@ -1,3 +1,8 @@
 #!/bin/sh -x
 
-adb pull /sdcard/clockworkmod/backup backup
+sdcard=/sdcard/clockworkmod/
+
+adb shell ls -1 -d $sdcard/backup/* | sed "s!$sdcard/*!!" | tr -d '\r' > /tmp/backup.android
+ls -1 -d backup/* > /tmp/backup.disk
+diff -uw /tmp/backup.android /tmp/backup.disk | grep -- '^-backup' | sed 's/^-//' | \
+xargs -i sh -xc "mkdir {} && adb pull $sdcard/{} {}"