Backing up is an boring yet important thing to be done periodically. There are multiple ways to backup phone data:-
- Manual copy paste of folders
- Using 1 click software
- Using terminal
- Manual copy paste is slow and needs lot of attention to detail (to ensure things are done correctly)
- Using software usually gives you the backup in a special format, which cannot be opened, unless restored to a mobile device. These softwares can be pricy
- Using terminal is an automated way of doing things. I am elaborating on this approach
adb devices
adb pull sdcard c://mybackupfolder
Sometimes this would fail, as some applications have restricted access to their folder. From my experience, this is likely to happen only in the Android
folder. Therefore I have a written this script
My script logs the files and folders to the android device. Move this file to your PC. Then run the batch script. The batch script loops through each file and does a adb pull sdcard/folder1 c://backupfolder/folder1
to all the folders except Android folder. We can manually copy our data from Android folder later.
adb devices
adb shell
cd sdcard
. This is the internal sdcard folderls
. Lists the contents of your device. If it looks correct, then write the next command.ls > mobilecontentlist.txt 2> testerrors.txt
. This logs runs the command that outputs the list of contents of the mobile device. If run successfully, the logs are stored inmobilecontentlist.txt
. If it fails, then error logs are stored intesterrors.txt
- Transfer
mobilecontentlist.txt
to your PC. Put it in the same folder as the place you want your backup folder. Ensurebackup-android.bat
also is in the same folder. - Run
backup-android.bat
- Your backup will run
- Copy data you want to save from Android folder manually