DevShaft / Backup-TA

121 stars 54 forks source link

Another version of linux backup #12

Open wingedfox opened 9 years ago

wingedfox commented 9 years ago

Android scripting made a bit cleaner, implemented backup part

tomchiverton commented 9 years ago

Nice tidy up, but I'm interested in where the master script does +for i in scripts/*.sh ; do

There's a chance scripts could be run in different orders, isn't there, so if there are now or in future dependencies they may go wrong ?

wingedfox commented 9 years ago

There's no problem with that, all included scripts contains the functions which are executed in the correct order.

petslane commented 9 years ago

Tested on linux with Sony Z3 compact. First run failed with error message "dd: can't open '/storage/sdcard1/backupTA.img': Read-only file system" http://pastebin.com/WvScxXZq

Checked scripts/backup.bat file and looks like windows version stores this file in /sdcard/, so changed target folder to /sdcard. Also, looks like linux version expects backup file to be in /sdcard folder when cleaning up. Current scripts/backup.sh:

$ grep -r /sdcard *.sh
backup.sh:  realSdCard=$($ADB shell su -c "$BB readlink -n /sdcard1")
backup.sh:  $ADB shell rm /sdcard/backupTA.img > /dev/null 2>&1

Changed to: scripts/backup.sh: realSdCard=$($ADB shell su -c "$BB readlink -n /sdcard")

After changing target path, second run was successful. http://pastebin.com/NQbCawe6 Except for there errors:

scripts/init.sh: line 41: restore_dispose: command not found
scripts/init.sh: line 42: convert_dispose: command not found

Result of second run:

$ ls -lh backup/
total 324K
-rw-r--r-- 1 petslane petslane 321K veebr  1 14:23 TA-backup-20150201.122506?.zip

In CLI backuped filename contains "?" symbol. But Caja file manager shows that it's actually \0000. filename

tomchiverton commented 9 years ago

Restore support isn't written yet as far as I know, hence those warnings.

wingedfox commented 9 years ago

@petslane, thanks for your reply. First of all, I've found an issue on all my sony devices that I can't pull image from sdcard (aka internal storage), adb pull simply works with a different file system, then it seen from within the device. Probably it is anissue of Ubuntu 14.04 with the used adb, but can't tell that for sure. I'll try to fix sdcard/sdcard1 issue when find some time for that.

All other features are not implemented yet, have to find some free time for that first =)

tomchiverton commented 9 years ago

@wingedfox all my testing was done on Ubuntu 14.04 LTS, against a Z1 compact, where it worked fine. Exactly what is going wrong ?

wingedfox commented 9 years ago

@tomchiverton, 'Cannot find TA.img' while using adb pull from sdcard Do you use x64 Ubuntu?

tomchiverton commented 9 years ago

No, 32bit. I'm using the 'android-tools-adb' package.