From d87724345ff0227de597f00fd75a8dade0fe1eb3 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 18 Jul 2023 19:49:58 -0300 Subject: Feat: android-backup: sync sd cards --- android-backup | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/android-backup b/android-backup index d270ec6..1985f6b 100755 --- a/android-backup +++ b/android-backup @@ -15,24 +15,30 @@ function android_backup_files { USER_ID="0" fi - BASE="/storage/emulated/$USER_ID" + BASE="/storage" + EMULATED="$BASE/emulated/$USER_ID" # Files: full copy - #adb pull $BASE files/ + #adb pull $EMULATED files/ # Remove multimedia cache from backup #rm -rf files/Music # Files: full basic copy - #adb shell ls -1 $BASE | grep -v ^Music | while read file; do - # adb pull $BASE/$file files/ + #adb shell ls -1 $EMULATED | grep -v ^Music | while read file; do + # adb pull $EMULATED/$file files/ #done mkdir -p files/$USER_ID # Files: incremental basic copy - for file in `adb shell ls -1 $BASE | grep -v '^Music'`; do - adb-sync --delete --reverse $BASE/$file files/$USER_ID/ + for file in `adb shell ls -1 $EMULATED | grep -v '^Music'`; do + adb-sync --delete --reverse $EMULATED/$file files/$USER_ID/ + done + + # SD cards + for file in `adb shell ls -1 $BASE | grep -v "^self" | grep -v "^emulated"`; do + adb-sync --delete --reverse $BASE/$file files/ done } -- cgit v1.2.3