[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] pitchblack5691:
how this works???

HOW THIS WORKS (v_2) :

If you have a good amount of knowledge on shell scripting (which i know a little):

View full code with highlighted syntax and detailed comments, see pastebin entry

.

for others,

The package consists of:

zipbackup_v_2.zip

|

|------reqfiles.zip

| |

| |---META-INF.zip (META-INF folder)

| |---busybox (busybox binary)

| |---zip (zip binary)

|

|---zipbackup (main script)

how does it back up?

1. When the zipbackup is executed with superuser permissions and with correct commandline parameters it extracts the busybox, zip binary and META-INF.zip inside the

ziprecovery folder. then it copies the attached busybox binary and zip binary to /tmp/ and /system/xbin folder respectively and assigns 755 permission to both of them.

this busybox binary is necessary for creating .bz2 archives and zip binary is necessary for creating the flashable zip.

2. then it creates /sdcard/zipbackup/temp folder and starts archiving /cache or /data or /system or all the three according to your requirement and

places it inside the temp folder temporarily.

during archiving it also creates a log file of all the files archived and places it in /sdcard/zipbackup/logs/backup/

after archiving it generates a updater-script compatible with provided update-binary (included in the package)

then the META-INF.zip is extracted into the temp folder and creates a compatible META-INF folder tree and includes the

generated updater-script in it.

NOTE: since the compression is higher it may comparatively take longer to backup than a Nandroid backup so if it doesn't throw any errors and

the screen says "please wait...." Then please wait it's actually working! :D

2. Then a ziprecovery.sh script is generated. this script is necessary for flashing the zip package with clockworkmod.

3. then the busybox included with the package is moved to temp folder

3. Then the zip binary is invoked and the created archives (cache.tar.bz2, data.tar.bz2 and system.tar.bz2), ziprecovery.sh the META-INF folder and included busbox binary are

zipped in store mode as requiered by clockworkmod.

4. A md5 sum is generated for the created zip file and placed in /sdcard/zipbackup/logs/backup/ folder for your reference.

the flashable backup zip is placed in /sdcard/zipbackup/backups/

NOTE: the md5 sum generated is only for your reference and it will not be checked during restore

how does it restore?

1. when the created backup zip file is flashed via clockworkmod the updater script formats the /system and /data and /cache partition first.

then extracts the busybox binary from the recovery zip and places it in /tmp folder and assings 755 permissions to the temporary busybox.

then extracts the three archives (cache.tar.bz2, data.tar.bz2 and system.tar.bz2) to the root of the sd card temporarily. so make sure that you have free space in sdcard prior to restore.

then the ziprecovery.sh is extracted to /tmp and 755 permission is assingned to it.

2. the ziprecovery.sh is executed which inturn extracts the archives (cache.tar.bz2, data.tar.bz2 and system.tar.bz2) present in the root of the sd card (see 1)

to their respective partitions (/cache, /data and /system).

during restore it also creates a log file of all the files restored and places it in /sdcard/zipbackup/logs/restore/

after the extraction, the cache.tar.bz2, data.tar.bz2 and system.tar.bz2 archives are deleted from the root of the sd card.

the symlinks and permissions are preserved by default in a .tar.bz2 archive (because i have tested it personally many times and it works with me).

NOTE:

1. everybody interested in this and have a prior knowledge in shell scripting can add features and optimize ziprecovery,

provided, a link to this thread and credits where due are given in your version of zipbackup.

2. I will try to optimize and add additional features in upcoming releases.

i need your help to implement this zipbackup script package optimally and bug free.

thank you for spending your valuable time in reading my thread.

press thanks if i haved helped you.

-------------------------------------------gouthamthemostwanted-----------------------------------------------