Watch This Now!

Find Your Device:
Or Continue to Thread: [UTIL] BART-1.3.1 Backup and R…
19th September 2009, 10:06 PM |#1  
OP Retired Recognized Developer
Thanks Meter: 43
This script is based off of devsk's found here: If you are unfamiliar with switchrom, you should probably read that thread first.


1) cyanogen's 1.4 recovery image, Amon_Ra's recovery image, or any other that is based off of the 1.4 recovery image.
2) an extended partition isn't required but makes it easier.


rename bart-*.txt to
copy to /system/sd/
for example:
mv /sdcard/download/bart-0.9.8.txt /system/sd/
note: if using Amon_Ra's 1.2.3 recovery, bart-0.9.2 is already included. Either type 'utility' into the console or invoke bart without sh, file extension, or path. For example: "bart -s myrom" instead of "sh /system/sd/ -s myrom".

Optional: Create config file named bart.config and place in /system/sd/


ability to store/restore ROMs based on name
store/restore all made default (nandroid and entire ext partition)
ability to customize the store/restore process

The main difference between the different restores is what data is deleted before the restoration process, not what is restored. The ext backup is kept in a single tar/tar.gz file and is extracted after deleting whatever the user chose to delete.

-r: deletes entire ext partition (rm -rf *)
-b -r: deletes apps folders and dalvik cache (rm -rf app* dalv*)
-a -r: deletes apps_s and dalvik cache (rm -rf app_* dalv*)
-n -r: deletes nothing from /system/sd

This version stores backups in /sdcard/bart. If you want your old switchrom backups available to you, just copy or move them there.

mkdir /sdcard/bart
mv /sdcard/switchROM/* /sdcard/bart/
sh /system/sd/ [--noninteractive] [options] -s|--store [rom_name]
sh /system/sd/ [--noninteractive] [options] -r|--restore [rom_name]
sh /system/sd/ [--noninteractive] -d|--delete [rom_name]
sh /system/sd/ -l

-b|--base, nandroid apps dalvik_cache
-c|--compress, only used with -s
--reboot, only used with -r or -s
--shutdown, only used with -r or -s

Always specify options as separate words"
e.g. -c -r instead of -cr. It is required!
-r and -s need to be last or followed by rom_name.
--noninteractive needs to be first.

Don't use spaces or special characters in rom_name.
Compress will take longer but image will be smaller.


store a complete backup, prompt for rom_name (nandroid and entire ext partition)
sh /system/sd/ -s
store nandroid, /system/sd/apps*, and /system/sd/dalv* (original switchrom behavior)
sh /system/sd/ -b -s
store nandroid only and name it mycy_nand
sh /system/sd/ -n -s mycy_nand
store complete ext partition only
sh /system/sd/ -e -s
store /system/sd/apps* and system/sd/dalv* only
sh /system/sd/ -b -e -s
store nandroid, /system/sd/apps_* and system/sd/dav* only
sh /system/sd/ -n -a -s
restore complete backup (nandroid and entire ext partition)
sh /system/sd/ -r
restore nandroid, apps folder, and dalvik-cache (original switchrom behavior)
sh /system/sd/ -b -r
restore entire ext partition only
sh /system/sd/ -e -r
restore /system/sd/app* and /system/sd/dalv* (not nandroid, only apps* dalv* folders cleared first,rest of ext partition left intact)
sh /system/sd/ -b -e -r
delete a backed up rom
sh /system/sd/ -d
list available roms
sh /system/sd/ -l
Changelog: fixed bug where old nandroid backups were retained when same name was used. added battery level check before restoring to avoid it crapping out midway during restore process. added ability to send nandroid norecovery, noboot, nodata, and nosystem flags. Added verbose mode option for nandroid backup/restore. added ability to delete ext-backup or nandroid separately. Added extra output for verbose mode. added non-interactive mode added option to backup/restore app_s, dalvik-cache, and nandroid no longer tries to mount ext partition when -n option is given. checks whether or not it is in recovery mode, increased verbosity for verbose mode, code cleanup. ability to reboot/shutdown after store/restore, minor code cleanup removed recovery mode check since its not always accurate can now source a user config file. fixed the shbang added ability to backup/restore cache. cache backup is now default (cache option is now --nocache). Now works with recovery's that mount ext at either /sd-ext or /system/sd. fix to properly source bart.config on sd-ext as well (/sd-ext/bart.config or /system/sd/bart.config)

Much thanks to Devsk.


Of course I'll take your money.

Or you could donate to others that helped me. Such as:
cyanogen, Meltus, Amon_Ra, rgv151, Rogro82, Loccy, manup456, and many more.
Attached Files
File Type: txt bart-1.0.1.txt - [Click for QR Code] (15.0 KB, 912 views)
File Type: txt bart.example.config.txt - [Click for QR Code] (499 Bytes, 622 views)
File Type: txt bart-1.1.1.txt - [Click for QR Code] (15.2 KB, 492 views)
File Type: txt bart-1.2.0.txt - [Click for QR Code] (17.6 KB, 251 views)
File Type: txt bart-1.3.0.txt - [Click for QR Code] (17.7 KB, 183 views)
File Type: txt bart-1.3.1.txt - [Click for QR Code] (17.8 KB, 1223 views)
Last edited by dumfuq; 5th May 2010 at 08:37 PM.