diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-09-13 14:01:33 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-09-13 14:01:33 -0300 |
commit | 1d5630d6c4d45d8ab2954e6c3b11886a4f268317 (patch) | |
tree | 6a185b623100ac1cf62ed6b0a068eb24f3489665 /android-backup-mtp | |
parent | 7c97d1f94d5774a53892297a1bc4b168595b93a7 (diff) | |
download | utils-android-1d5630d6c4d45d8ab2954e6c3b11886a4f268317.tar.gz utils-android-1d5630d6c4d45d8ab2954e6c3b11886a4f268317.tar.bz2 |
Renames android-{backup,restore} to android-{backup,restore}-adb; adds android-backup-mtp
Diffstat (limited to 'android-backup-mtp')
-rwxr-xr-x | android-backup-mtp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/android-backup-mtp b/android-backup-mtp new file mode 100755 index 0000000..9eda7b6 --- /dev/null +++ b/android-backup-mtp @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# +# Android backups using MTP +# +# Overall procedure +# +# PROFILE="profile-name" +# PHONE="phone-name" +# go-mtpfs ~/temp/shared/$PHONE/$PROFILE & +# time rsync -av --delete ~/temp/shared/$PHONE/$PROFILE/ ~/sync/$PHONE/$PROFILE/ +# fusermount -u ~/temp/shared/$PHONE/$PROFILE +# + +# Parameters +BASENAME="`basename $0`" +PHONE="$1" +PROFILE="$2" +SHARED="$HOME/temp/shared/$PHONE/$PROFILE" +SYNCED="$HOME/sync/$PHONE/$PROFILE" +COMMANDS="go-mtpfs rsync fusermount" + +# Syntax check +if [ -z "$PROFILE" ]; then + echo "usage: $BASENAME <phone> <profile>" + + echo "" + echo "Overall procedure:" + echo "" + echo "For each user profile:" + echo "" + echo "1. Log into the profile on the phone." + echo "2. Export the contacts somewhere like Backups/Contacts/contacts.vcf." + echo "3. Run a local backup to the internal storage (to the .SeedVaultAndroidBackup folder)." + echo "4. Run Signal and Molly backups (to the Backups folder)." + echo "4. Mount the profile folder in the computer." + echo "5. Sync the profile in the respective folder." + echo "" + echo "The last two steps are done through $BASENAME commend" + + exit 1 +fi + +# Commands check +for tool in $COMMANDS; do + if ! which $tool &> /dev/null; then + echo "error: please install $tool" + exit 1 + fi +done + +# Backup +go-mtpfs $SHARED & +time rsync -av --delete $SHARED/ $SYNCED/ +fusermount -u $SHARED |