AppBack - App Backup/Restore Via ADB - G1 General

Hey everyone,
I just whipped up a quick Java based app that you can back up and restore your apps that you installed (the ones in the /data/app and /data/app-private dirs) It also backs up the settings for those apps.
I'll be adding in saving settings for apps that are in system/app later, but I thought this one was ready for a release.
You must have the /tools dir of your SDK in your path var in order for this to work.
Please verify that adb is detecting the device by running "adb devices" and make sure this there.
Un-archive the the zip and it will have a AppBack-x.x.class file in it
Usage is for backup run "java AppBack backup"
And for restore is "java AppBack restore"
This will create a dir "appback" with two dirs in it, "backup" contains the apk's and "settings" contains the app data.
If there's something you'd like to see, just post and I'll do as much as humanly possible to add it in
Note: Error handling is nasty, and future versions will be nicer (shocker isn't it )
(also, when you run it first you might get a operation not permitted error, just run it again and it *should* resolve itself, I'll fix it in the next release.)
I'm writing this right about when I should be sleeping, so I probably forgot something lol, but yeah, if you encounter an error, please report it.
Thanks alot!
Aakash Patel

Oh and btw, you might have to rename the class file to "AppBack.class"...

Nice, this should be handy, will definitly check out on my next flash. Does it handle setting the correct user owner/permissions on the folders in the data directories on a restore?

This is great, but maybe in the future let user choose what apps to backup and their settings.

Oh haha I forgot to mention that important part, you have to have root! >_<

so uh.. where does it create the appback directory, and how exactly are you supposed to run it... from the device or from a console or what.. i think i ran it but im not sure and im looking all over for a appback directory

Related

Quickly re-install all of your apps

Just a quick note to everyone who is constantly switching between ROM's with their 'daily driver' phone.
Make sure all of your apps are backed up using Astro or AppControl. They will be backed up to /sdcard/backups/apps.
Once your new ROM is installed, and your phone has been wiped, mount your SD card on your PC.
Open a command prompt and navigate to the \backups\apps folder on your SD card.
(this assumes that your adb.exe is in your PATH)
In the command prompt, type in:
for %%f in (*.apk) do adb install %%f
Watch all of your apps install! This really saves a lot of time over using Astro or AppControl to re-install all of your apps.
Absolutely brilliant!
I've done this dozens of times over the last couple weeks. I felt so dumb finding this little snippet of code after manually installing 100+ apps every time I wanted to try a new ROM.
Huh, how about a script to back up via adb? Or backup/restore app data?
Actually, the latter is far more important =P.
I think easy backup restore is with astro file manager...
SpaceBoy2000 said:
Huh, how about a script to back up via adb? Or backup/restore app data?
Actually, the latter is far more important =P.
Click to expand...
Click to collapse
That's more difficult since the data is stored in a DB inside Android (for most apps, anyway). I noticed there is a sqlite3.exe inside the Android SDK so I assume you can query the DB using that and extract certain data, for example SMS and call history, just need to invest a bit of time reading up I think!

Location of apps after app2sd?

With root explorer, i see that my apps are saved to something like '/system/sd/app,' but when I mount my G1, I can't find that folder. I can't even find the "system" folder. Anyone have any ideas?
Also, I pressed the "R/W" button on that folder in Root Explorer, but now I can't switch it back to R/O. It gives me an error saying, "Remount Failed: Device or resource busy."
what is it you want to do with the apps?
My gmail app is force closing, and I haven't found a way to reinstall it through market. I was going to try to replace the .apk.
I don't believe the gmail app is on the SD, it should be under /system/app/Gmail.apk
For the most part, the system apps install on the phone, the rest are on SD.
That still leads me to my first question, lol. I can't find the "system" folder after mounting my G1.
??
I don't know. I use the rooted file browser SUFBS and have never had a problem seeing the system folder.
Might have been associated with other changes you made to the system.
For me, if all else fails, I re-partition, wipe & re-flash.
Hopefully someone else can offer some better info.
I find it fine on my G1 via Root Explorer. It's just that I can't seem to locate it on my computer (i.e something like h:\system\app), after plugging my G1 in.
Sorry for any confusion.
You must be on a windows machine. You can not nativly see an ext partition under windows.
Look at the guides that tell you how to set up adb and adb push the application to the folder you want.
adobrakic said:
I find it fine on my G1 via Root Explorer. It's just that I can't seem to locate it on my computer (i.e something like h:\system\app), after plugging my G1 in.
Sorry for any confusion.
Click to expand...
Click to collapse
You can do these things right from recovery console, and probably terminal, I like recovery better though. place the file you want to use on the root of the SDcard. Since it is the Gmail.apk you want to replace you would go about it like this:
mount system
mount sdcard
cp /sdcard/Gmail.apk /system/app/Gmail.apk
reboot
thats pretty much it.

Please help me, i Lost my "Accounts &sync"

I was using Titanium Backup to uninstall some of the apps that came with my Vibrant. I made sure to hit the back up button in Titanium Backup before I un-installed "Accounts & Sync" (I wanted to uninstall it because the icon in the app draw was annoying to me). So i deleted it and now I cant access my account and Titanium Backup wont let me restore. I was wondering if someone could please help me. Thank you..
The app was only a shortcut to Accounts & Sync.. just go into settings -> Accounts & Sync.
Thats my problem, It isnt there in the setting app..
Thats weird because I uninstalled it and it was still there even after i rebooted the phone.
You could always use ADB and push the .apk back into /system/app
How do I do that? And where can I find the .apk ?
MichaelB91 said:
How do I do that? And where can I find the .apk ?
Click to expand...
Click to collapse
Mhmmm thought you backed it up? do you have a ADB environment set up properly? It'll take a little bit of time to fully set that up.
All I did was hit the back up button in titanium backup, and I dont know how to reinstall it from that. No I dont, I dont even know what that is..
MichaelB91 said:
All I did was hit the back up button in titanium backup, and I dont know how to reinstall it from that. No I dont, I dont even know what that is..
Click to expand...
Click to collapse
Download: http://de.codeplex.com/releases/view/48865
Driver: http://forum.xda-developers.com/showthread.php?t=728929
-- Download corresponding to your OS (whether its running on x64 or x86)
Once that's done and the SDK environment is fully setup by Droid Explorer. Make sure it downloads SDK files and such.
1. Settings -> Applications -> Developement.. make sure that USB debugging is enabled
2. Connect phone via USB
aaaaaaaand follow this guide http://forum.xda-developers.com/showthread.php?t=532719 starting at
Check if your phone is detected by ADB once you fully installed Droid Explorer + Drivers
except for the first part where it says:cd C:\android-sdk-windows\tools === Press Enter
do
cd C:\Program Files\Droid Explorer\SDK\tools
Click to expand...
Click to collapse
instead
It'll take some time to set this all up and when you finally do just put AccountAndSync.apk and AccountAndSync.odex to /system/app and it everything should be good again.
Update: Backed up my apps before i started deleting them and uploaded you a backup of AccountAndSync http://www.mediafire.com/?d95wccd37kfgaic
I will give it a try, Thank you very much. Ill let you know how it goes.
for ADB:
* adb remount
* adb shell cp /sdcard/AccountAndSync.apk /system/app
* adb shell cp /sdcard/AccountAndSync.odex /system/app
Click to expand...
Click to collapse
^^ for this to work place the two files in the .zip that i made into the root of /sdcard/ (14GB not the 2GB)
After looking around.. you could possibly get a app called Root Explorer (paid app) and have the same result.
* In Root Explorer, copy the apk file you want to put in /system/app
* Navigate to the /system/app directory
* Tap the Mount R/W button on the top right
* Tap Paste
* Scroll down to the pasted apk, long press on it and select Permissions (you'll see 9 check boxes when you do this)
* Check the Read and Write buttons for User, and only the Read boxes next to Group and Others, then tap OK (once you're done, the read/write permissions under the app name should be the same as all the other apps listed (rw-r--r--))
* Reboot.
Click to expand...
Click to collapse
I'm off to bed though. I'll check in tomorrow.
I tired using Droid Explorer but that didnt work, so then I went and bought "root explorer" and did everything as you said but it didnt work.. I dont know if this makes a difference but when I went into the properties for accountsandsync it said Owner: System
Group is sdcard_rw
While everything else in the /system/app folder says
Owner: Root
Group: Root.
made a new thread, did not want to hijack someone else help thread.
MichaelB91 said:
All I did was hit the back up button in titanium backup, and I dont know how to reinstall it from that. No I dont, I dont even know what that is..
Click to expand...
Click to collapse
I am in the exact same place. I used Titanium Backup to remove Account & Sync and now it is missing completely. I did do a backup from within Titanium Backup, but when I went to use the Restore feature, it wasn't available. I found a support page for Titanium Backup (http://matrixrewriter.com/android) and FAQ #10 states:
#10: Why is the "Restore" button disabled for some system apps ?
◦System apps are part of your ROM, so Titanium Backup will only backup their data (not the apps themselves). For this reason, if you backup a system app, and then switch to a ROM where that app is missing, Titanium Backup obviously cannot restore the data for it.
I just wish it would have made this more clear when I was doing the backup in the app.
zephiK said:
The app was only a shortcut to Accounts & Sync.. just go into settings -> Accounts & Sync.
Click to expand...
Click to collapse
At first, after removing Accounts & Sync using Titanium Backup, the option was still available from Settings -> Accounts & Sync. However, when I actually tried to go into it, it failed to start and it was somehow removed completely from the menu.
I have followed your steps for setting up Droid Explorer. I can get it to communicate with the phone, although it does show a '$' instead of a '#' when typing "adb shell" into the Command Prompt. I have copied the .apk and .odex files from the Zip you provided into the root of the device.
When I attempted to use the adb commands you listed, I get errors for all of them. For "adb remount" it says "remount failed: No such file or directory." For both "adb shell cp /sdcard/AccountAndSync.apk /system/app" and "adb shell cp /sdcard/AccountAndSync.odex /system/app" it says "cp: not found."
I then moved on to trying the Root Explorer app directly from the phone. I found the .apk and .odex files in the root of the /sdcard folder. I tried to copy and paste them into the the /system/app folder, but they never appear to paste correctly. It does not give me an error, but it never shows up in the correct spot, either. One thing is that you said I must press Mount R/W, however the system/app folder already says it's opened in R/W. The only option on the top right is Mount R/O, but pressing it doesn't appear to do anything.
I'm not sure what to do from here. Any help would be appreciated.
Thanks,
Yogi
Okay, I figured out what happened. Titanium Backup shows two "Accounts and Sync" apps... one is the actual app and the other is the icon that links to the app. I had removed both accidentally. I downloaded the AccountAndSync.apk someone posted in another thread and installed it with ADB. It brought the icon back, but not the actual application. Could someone please upload the .apk for the actual Accounts and Sync app?
Yogi76 said:
Okay, I figured out what happened. Titanium Backup shows two "Accounts and Sync" apps... one is the actual app and the other is the icon that links to the app. I had removed both accidentally. I downloaded the AccountAndSync.apk someone posted in another thread and installed it with ADB. It brought the icon back, but not the actual application. Could someone please upload the .apk for the actual Accounts and Sync app?
Click to expand...
Click to collapse
http://www.mediafire.com/?r1mrbtsep2k84kb uploaded.. i was tired that day :X
includes BOTH settings and actual app.
Thank you soooo much! it worked!
Worked for me, too. Thanks!
Just to help everyone else in the case you deleted some other pre-installed app and you do not have a backup -
http://samsungvibranthacks.com/samsung-vibrant-hacks/samsung-vibrant-system-dump-default-apps/
Awesome, thanks. that will probably come in handy
MichaelB91 said:
Thank you soooo much! it worked!
Click to expand...
Click to collapse
Thank yogi for reminding that there are two apps for accounts and settings. Been busy and didn't look now in depth and the other night I was pretty tired. Only the settings need to be installed. But I included both for the hell of it.
Sent from my SGH-T959 using XDA App

Rooting through a noob's eyes

I'm not sure how this will be taken by the people here. Everyone seems really helpful when other people ask questions or need help so I may be surprised, but after rooting my Incredible last night and then trying to look into boot animations, removing bloatware and other things I was left with some feelings that took the joy out of being rooted and I wanted to share them.
Laugh if you will, insult if you feel it's necessary. I'm old enough to be able to handle it but beyond all of that I just wanted to say that the "rooting community" are a brilliant bunch of people. The things that you guys do boggles my mind. Since I only just registered I'm forbidden to post links, but if you're so inclined to go read it here it is.
ishootpixels.tumblr.com/
EDIT: I'd also like to add that my wife's netbook is running XP and not Vista. I forgot that we downgraded it (or upgraded however you want to look at it). I've gone back and changed my blog post.
If you would like some help getting where you want to be, PM me and I would be glad to help. I am far from an expert, but after scouring these forums endlessly, I am quite familiar with the process.
@mtag1029 Thanks. I guess my first problem is that whenever I type in "adb" anything, I get that "adb is not recognized as an internal or external command, operable program or batch file."
I've used this method to connect the phone to the netbook...
1. Boot into Clockworkmod recovery by powering off the phone and pressing and holding the volume down and power button until the screen lights up.
2. At the menu press volume down to select Recovery, then press power.
3. At the Clockworkmod main menu select partitions menu, then select mount /system
4. On the computer click Start > Run, and type CMD to open a command prompt.
5. In the command prompt type cd\sdk\tools
6. At the command prompt type adb shell. Now you’re in the phone’s OS.
and I get as far as step 6 before I can't go any further which is where I get that message. Right now I'm trying to install a boot animation and sound but I'll also need to be able to get beyond this in order to remove the bloatware. What am I doing wrong?
And THANK YOU again for the help. I'm almost to the point of returning it to stock so I'll at least be able to get Froyo whenever it's released OTA, but I've come so far at this point I'd hate to throw it all away and go back to stock.
IShootPixels said:
5. In the command prompt type cd\sdk\tools
6. At the command prompt type adb shell. Now you’re in the phone’s OS.
Click to expand...
Click to collapse
Assuming your sdk folder is in the root of the C drive (i.e. C:\sdk\), the command in step 5 is wrong -- it's supposed to be:
Code:
cd \sdk\tools
with a space. That should get you into the C:\sdk\tools directory, where adb is.
Not sure if the lack of spacing was just a typo, but if not, there ya go Let me know how it works
edit: Just tried cd\sdk\tools, actually works, I thought there had to be a space, but maybe not. I guess the next step would be to make sure there's an adb.exe in your tools folder?
I created a file folder under Local Disk C called "sdk" and inside that I created another folder "tools". I couldn't find folders that were already named this so I created them myself. That may be wrong so it wouldn't surprise me if that's my first mistake.
Beyond that, when I get into running command lines I have gotten to where it looks like this...
C:\sdk\tools>
No spaces. I'm taking a pic and trying to attach it if my noob status on the forums will allow me.
I don't have the exe file. I didn't need it to root the phone. I don't know where to even get it.
IShootPixels said:
I created a file folder under Local Disk C called "sdk" and inside that I created another folder "tools". I couldn't find folders that were already named this so I created them myself. That may be wrong so it wouldn't surprise me if that's my first mistake.
Click to expand...
Click to collapse
If you just made the folders, there's nothing in them -- if you go to the tools directory and type "dir", there probably won't be any files unless you extracted some in there.
From the how 2 adb thread by dreamersipaq:
1) Setting up ADB
ADB stands for Android Development Bridge. It is used by Android developers for programming. For us, it is used to hack into our phones . For our purposes, just know that it is like the cmd (command prompt) that allows us to send commands to our phone. This is extremely useful when we're in the custom recovery
Download the Android SDK from Google: http://developer.android.com/sdk/index.html
Unzip to your desktop
Take the "android-sdk-_**-windows" folder and move it to the root of your hard drive (C:\)
** will change, it is revision of SDK, like "r6"
****The below is not necessary, but is useful sometimes if you just want to run "adb shell" from anywhere without going into the sdk directory****
Right click on My Computer and click properties
Select the Advanced Tab or Advanced System Setting (Vista/Windows 7)
Select Environment Variables...
Press New
For Variable Name type: adb
For Variable Value type: C:\android-sdk-_**-windows\tools
****End of the "This is not necessary thing****
Click to expand...
Click to collapse
edit: the rest of that thread is located http://forum.xda-developers.com/showthread.php?t=709220 there, if you're interested
gmonox is absolutely correct. You cannot just create the folders. They have to come from the sdk.
Another thing. You mentioned in your blog post that you would like to have froyo. Froyo should be flashed before removing any apps becauseeverything that you have removed will be put back in with froyo.
Wow, that was a pretty necessary step that I never knew about. Okay, so I DL'd, unzipped, and copied the folder to the root of C. Question, do I have to rename the "android-sdk-windows" folder to simply "sdk" when following the directions I listed earlier or do I leave it and at the command line type...
cd\android-sdk-windows\tools
I also didn't do the "advanced" part of the post simply because it's my wife's PC and I'm really not in the mood to screw up anything else today.
EDIT: And about Froyo, right now I just want to see if I can get a little boot animation working before I even THINK about tackling ROMs, Kernals or anything else. Although I know that most ROMs have the kernals that are optimized for that particular ROM if I've read things right. I realize Froyo is not a mod so it won't have an overclocked kernal but I read that others might. I've read that Froyo packs in VZ Nav (like I didn't have enough of that crap with my old Blackberry) amongst other things. If nothing else, I'm really good at reading about all of the things that I wish I could do.
IShootPixels said:
Wow, that was a pretty necessary step that I never knew about. Okay, so I DL'd, unzipped, and copied the folder to the root of C. Question, do I have to rename the "android-sdk-windows" folder to simply "sdk" when following the directions I listed earlier or do I leave it and at the command line type...
cd\android-sdk-windows\tools
I also didn't do the "advanced" part of the post simply because it's my wife's PC and I'm really not in the mood to screw up anything else today.
EDIT: And about Froyo, right now I just want to see if I can get a little boot animation working before I even THINK about tackling ROMs, Kernals or anything else. Although I know that most ROMs have the kernals that are optimized for that particular ROM if I've read things right. I realize Froyo is not a mod so it won't have an overclocked kernal but I read that others might. I've read that Froyo packs in VZ Nav (like I didn't have enough of that crap with my old Blackberry) amongst other things. If nothing else, I'm really good at reading about all of the things that I wish I could do.
Click to expand...
Click to collapse
Either way works. I renamed mine sdk because I'm too lazy to type android-sdk-windows every time I want to go into adb shell. But it's up to you
Ok, I'm guessing that my question will be answered after I run the setup. I didn't see the link at first to the thread. Apparently my wife's netbook doesn't even have the right java ver. to run the setup.
This is making my brain hurt.
I should have asked this earlier, have you made a nandroid backup?
LOL. Actually as soon as I finished rooting the phone I DL'd Titanium from Marketplace and installed it and BusyBox and made a backup that way. Then I remembered Nandroid and went in and backed up that way too. Probably overkill but the whole process has scared the crap outta me. I wouldn't know how to apply these backups, but at least I have them.
At the moment I'm installing the Documentation for Android SDK, API 8, revision 1
EDIT: This is going to take awhile I'm guessing. Installing SDK Platform Android 2.2, API 8, revision 2
Okay. The nandroid is the most important. It will save your butt if something goes wrong.
IShootPixels said:
LOL. Actually as soon as I finished rooting the phone I DL'd Titanium from Marketplace and installed it and BusyBox and made a backup that way. Then I remembered Nandroid and went in and backed up that way too. Probably overkill but the whole process has scared the crap outta me. I wouldn't know how to apply these backups, but at least I have them.
At the moment I'm installing the Documentation for Android SDK, API 8, revision 1
Click to expand...
Click to collapse
Both types of backups are easy to restore, for nandroid you just go into recovery, same place as you backed it up but click Restore and just wait for it. For titanium, go into backup/restore, batch, and there's an option to restore apps, apps+data, and apps+system data I think. If you have the paid version, the apps will all install on their own, but if not I don't think they will.
Are you still on a netbook or can you use a pc? Might be easier if your java's out of date and whatnot to just use a pc, I'm no expert on netbooks but I'd imagine they're stripped down a lot
gmonox said:
Both types of backups are easy to restore
Click to expand...
Click to collapse
Just keep in mind that you need a functioning phone in order to use Titanium. If you mess something up while in adb and the phone will not boot, Titanium is useless. A nandroid however will restore you back exactly how you were before messing around in adb even if the os will not boot.
Well then I'm glad I did the Nandroid BU! Bsically then I guess that because I backed up with Ti first and then with Nandroid, the Nandroid created a back up of my Ti backup. If so I think I just set a record for redundancy.
As for using a netbook, I don't have a choice. I run everything off of my Macbook, or did until now. The only Windows based item in the house aside from my Xboxes is my wife's netbook. I've updated the Java and begun the setup process. I had to do as the thread said and force the http and then go into the available packages and I'm DLing and installing them all because I was afriad that if I didn't I'd find that I needed one I hadn't installed. I'm guessing that since I'm already rooted (and I'm hoping) that once I'm done installing all of these packages that that should be it except for step #4 and #5.
1. Run SDK Setup.exe
2. If it gives you any error go to settings and click on "Force http//....."
3. Select usb driver package, let it download and install
4. Some say the below step is not needed, but I did this so I'm posting it
Go to tools folder, and edit "android_winusb.inf" (you can do this by opening it via wordpad). Add the following at the end of the [Google.NTx86] and [Google.NTamd64] blocks:
;HTC Incredible
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E&MI_01
%SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0C94
Save the file and exit.
5). Plug your phone into PC, when windows asks to install drivers for new found hardware, point the New Hardware Found wizaed to android_winusb.inf that you just edited.
I'd also like to add that this is the YouTube video that started this mess. I followed his tutorial on rooting the phone and although the sound was low it was pretty spot on minus one or two things he failed to mention.
However, after watching this video I thought it would be just as easy to install the boot animation as it was to root the phone. Seems the bigger task would be rooting rather than a boot animation. In the hours that you guys have helped me I've learn that this boot video lacks a TRUCK LOAD of information and assumes that the person watching it isn't a noob. Dont' most people that watch tutorial videos watch them because they have no idea what they're doing? I realize now that there's a ton o' stuff missing from it. I still want the animation and sound though.
http://www.youtube.com/watch?v=-Ju9lpH7_4g&feature=channel
Titanium stores backups on your SD card. Nandroid does not backup your SD card, but you are in good shape. Keep us posted.
I'm not sure if step 4 is required, I'm on win7 64bit and I don't recall doing it, but I guess it couldn't hurt. Also, I don't think nandroid backs up your titanium backup -- Ti backup is stored on your SD card

[Script] VERY simple application backup script for ROM upgrades [not for newbies]

Hi,
I'm new to the business and I spent some time to learn the environment trying different applications and different approaches for almos every action I took. Today, I have not much bigger knowledge, but I finally decided to take few things in my own hands because existing software is not fulfilling my wishes.
I started with this simple script which eases the pain of reinstalling all applications after ROM upgrade. There are few such tools already, but I found those quite bloated with unnecessary thing for my own approach.
With this script I assume:
1. There is/was SSHDroid installed (or any tool with busybox and you can access shell command line) both in old and new ROMs and your ROM have bash installed in /system/bin/.
2. Backup/restore operation includes only INTERNALLY installed applications, it completely ignores SYSTEM and SDCARD installed ones.
3. This is TEMPORARY backup so it should be as fast as possible not caring about occupied space (!). Althought I added -zip parameter to enable compression if you are running out of space on your sd.
4. Installed ROM is clean with no additional apps installed (excluding those needed by the script)
5. You have basic knowledge about bash scripting, because I take NO RESPONSIBILITY of the script behavior or data loss it can do.
So, basically it is simple. It runs like this:
1. On old ROM type: sbackup -backup
2. Flash your ROM
3. On new rom type: sbackup -restore
Just like that. The applications data is tar'ed in one file per application so if you want to get rid of any, just delete it from backup directory. The directory name is same as script name on sdcard but you can change it adding a parameter without a '-' sign at runtime (first non-option parameter is treated as backup directory path). The file is zipped because this forum disallows files without an extension so... it is zipped ;D
It was tested on my fresh LeeDroid 3.3.3 GB AFTER i installed some apps. I backed them up and then restored. All seems to be perfect right now, but I will test it more thoroghly very soon because I'm planninig to have CM7 based ROM too just to choose that I need Sense or not (two nandroids for fast switch weekly ;P).
With this script and MyBackup functionality of backing up contacts, sms, history and similar it should be quite complete approach to restore all the data needed on the fresh ROM. In the future maybe I will look at the MyBackup part too. Maybe.
Feel free to comment, use, suggest or anything you like, and have fun ;P.
How do I run this script? Do i run it from sdcard or from system /bin? When i do it from system bin it says cannot create directory. When i run it from sdcard/sbackup it says permissions denied?
Sent from my ADR6400L using Tapatalk
jgrimberg1979 said:
How do I run this script? Do i run it from sdcard or from system /bin? When i do it from system bin it says cannot create directory. When i run it from sdcard/sbackup it says permissions denied?
Sent from my ADR6400L using Tapatalk
Click to expand...
Click to collapse
And thats why I mentioned in topic about not being a newbie (and I meant not forum newbie but more a linux newbie). The thing is, it's a simple script - without any user-proof capabilities, comments inside or something BUT...
But ok, I will try to help you run it. First of all, you have to set permissions to the script. It has to have executable permission to be run by the system (and I mean filesystem permission). This can be done by chmod instruction of busybox. Most of the times it's done like this:
chmod 755 filename
This is a reason of not running form sdcard if your sdcard is NOT ext filesystem (it is usually windows fat filesystem not to generate problems with reading it under windows).
Second thing to run is to have /system/bin/bash because first line of the script (a comment like this: #!/system/bin/bash) instructs busybox to execute script using bash. This can be simply changed by modifying this line, but you have to remember that changing the shell executing script have consequences. Differens shells have sometimes different syntax, althoght i wrote this script simply so it should run on most of them, especially sh.
Third thing is to have write permissions to the directory in which the backup will be created. In original version of the script it is /sdcard, because backup is made in /sdcard/sbackup. So, you have to check it (second error - problems with creating directory).
And a last tip - it can be run from ANYWHERE. Even if your partition does not alolow executing, you can do it like this:
bash-3.2# /sdcard/test
bash: /sdcard/test: /system/bin/bash: bad interpreter: Permission denied
bash-3.2# . /sdcard/test
OK
bash-3.2#
First try does not succeded, but second did. The trick is a dot which means to execute file with a shell not caring about why or permissions.
And thats most simple introduction I could write. It applies to ANY script you want to run.
Please anyone - if you want me to help, paste your results here because without a precise error message it can be very hard to deduce what caused for example permission denial or anything usual.
For now, I won't add any more error handling, but if there will be more users caring about, I will add it.

Categories

Resources