Created
December 23, 2018 19:27
-
-
Save KrisKodira/e875055e5a45131f10c7bc2101c64bf8 to your computer and use it in GitHub Desktop.
Android Phone Backupscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
{ | |
echo "Started phone backup at " $(date) >> /home/kris/scripts/backup/phone-backup-log.txt | |
backupFolder=phone_$(date +%d_%m_%Y) | |
mkdir /home/kris/backups/$backupFolder | |
cd /home/kris/backups | |
adb pull /sdcard/DCIM/Camera $backupFolder | |
adb pull /sdcard/Documents $backupFolder | |
adb pull /sdcard/Pictures $backupFolder | |
zip -r $backupFolder.zip $backupFolder | |
chmod 777 $backupFolder.zip | |
rm -rf $backupFolder | |
echo "Finished phone backup at " $(date) >> /home/kris/scripts/backup/phone-backup-log.txt | |
} & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment