webOS Nation Forums >  webOS apps and software >  webOS development > Running bash/sh scripts from a webos app
Running bash/sh scripts from a webos app

  Reply
 
LinkBack Thread Tools Display Modes
Old 11/25/2009, 03:24 PM   #201 (permalink)
Member
 
DrewPre's Avatar
 
Join Date: Aug 2009
Location: The HARD Streets of Alpharetta, GA
Posts: 829
Likes Received: 2
Thanks: 44
Thanked 176 Times in 92 Posts
Default

you know.... I don't see it.

if all else fails install via 'ipkg-opt install tar'
DrewPre is offline   Reply With Quote
Old 11/25/2009, 03:25 PM   #202 (permalink)
Member
 
DrewPre's Avatar
 
Join Date: Aug 2009
Location: The HARD Streets of Alpharetta, GA
Posts: 829
Likes Received: 2
Thanks: 44
Thanked 176 Times in 92 Posts
Default

make sure you are root [sudo -i] and run ipkg-opt install tar
DrewPre is offline   Reply With Quote
Old 11/25/2009, 03:33 PM   #203 (permalink)
Member
 
Join Date: Oct 2009
Posts: 29
Likes Received: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Default

I installed it from the Index page and still nothing.
Aerode120 is offline   Reply With Quote
Old 11/25/2009, 03:34 PM   #204 (permalink)
Member
 
Join Date: Oct 2009
Posts: 29
Likes Received: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Default

These are the only 4 files in /opt/bin/

Code:
root@castle: ls -l /opt/bin
  -rwxr-xr-x    1 root     root          237 Nov 25 14:53 bldExList
  -rwxr-xr-x    1 root     root          236 Nov 25 14:54 bldIncList
  -rwxr-xr-x    1 root     root          697 Nov 25 14:54 ppbku
  -rwxr-xr-x    1 root     root          354 Nov 25 14:55 pprstr
Aerode120 is offline   Reply With Quote
Old 11/25/2009, 03:48 PM   #205 (permalink)
Member
 
Join Date: Jul 2009
Posts: 30
Likes Received: 0
Thanks: 5
Thanked 3 Times in 3 Posts
Default

FWIW, I had originally copied the service files from the zip to the directories manually, and I was not getting a ppbackup folder.

after the ipk was posted, i reinstalled the service via webos quick install, but i did not delete the original service files, so I am not sure what is left, but I am creating backup files now. i also restarted the phone before trying.

will try to restore my backup file to the new phone in a little bit now that the file picker is working and post the results
jmelan is offline   Reply With Quote
Old 11/25/2009, 03:56 PM   #206 (permalink)
Member
 
SirWill's Avatar
 
Join Date: Jun 2009
Location: Everett, WA
Posts: 441
Likes Received: 0
Thanks: 63
Thanked 48 Times in 41 Posts
Default

Quote:
Originally Posted by Aerode120 View Post
I installed it from the Index page and still nothing.
Well, that is strange. But try it as mentioned above.

make sure you are root [sudo -i] and run ipkg-opt install tar

You can do this from novaterm, or putty, or on device using terminal.
__________________
-----------------
Palm III, Palm IIIc, TT, T3, T5, TX, Pre from Day 1.
SirWill is offline   Reply With Quote
Old 11/25/2009, 04:25 PM   #207 (permalink)
Member
 
Join Date: Jul 2009
Posts: 30
Likes Received: 0
Thanks: 5
Thanked 3 Times in 3 Posts
Default

well i was able to choose the file and start the restore.

it has now been running for ~ 20 minutes. not sure if it should be taking this long?

...30 minutes

stopped the program, restarted and looks like everything was succesfully restored hopefully i don't find any problems

thanks drewpre

Last edited by jmelan; 11/25/2009 at 04:43 PM.
jmelan is offline   Reply With Quote
Old 11/25/2009, 05:25 PM   #208 (permalink)
Member
 
DrewPre's Avatar
 
Join Date: Aug 2009
Location: The HARD Streets of Alpharetta, GA
Posts: 829
Likes Received: 2
Thanks: 44
Thanked 176 Times in 92 Posts
Default

yea, it does that. It'll run, & run & run. Even tho it has finished successfully. Not sure how to trouble shoot that. It doesn't do that in the emulator. And the real Pre does have logging enabled for apps. I suspect it's waiting for feed back from the svc. I don't know tho. It shouldn't take more than 5 or 6 mins.
DrewPre is offline   Reply With Quote
Old 11/25/2009, 05:50 PM   #209 (permalink)
Member
 
Join Date: Oct 2009
Posts: 29
Likes Received: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Is is possible for me to simply copy the needed file into /opt/bin/? If so where would I get it?
Aerode120 is offline   Reply With Quote
Old 11/25/2009, 07:47 PM   #210 (permalink)
Member
 
Join Date: Oct 2009
Posts: 29
Likes Received: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Ok so I ran 'ls -l /var/opt/bin' and got the following results:

Code:
root@castle: ls -l /var/opt/bin
  -rwxr-xr-x    1 root     root          237 Nov 25 00:21 bldExList
  -rwxr-xr-x    1 root     root          236 Nov 25 00:21 bldIncList
  -rwxr-xr-x    1 root     root       303536 Mar 14  2009 gnutar
  -rwxr-xr-x    1 root     root          697 Nov 25 00:21 ppbku
  -rwxr-xr-x    1 root     root          354 Nov 25 00:21 pprstr
  -rwxr-xr-x    1 root     root       303536 Mar 14  2009 tar
root@castle:
Look the Tar!!!! I am not sure what the mar 14th is all about tho...

But 'ls -l /opt/bin' returns:

Code:
root@castle: ls -l /opt/bin
  -rwxr-xr-x    1 root     root          237 Nov 25 14:53 bldExList
  -rwxr-xr-x    1 root     root          236 Nov 25 14:54 bldIncList
  -rwxr-xr-x    1 root     root          697 Nov 25 14:54 ppbku
  -rwxr-xr-x    1 root     root          354 Nov 25 14:55 pprstr
root@castle:
So I went back to the orginal commands. CHMOD with the added /var

Then I ran your following three commands but I still get an error:missing value at charater 9.

Code:
root@castle: param=\"/var/luna\\\\n/var/palm\\\\n/opt/bin\" 
root@castle: luna-send -n 1 palm://com.tntservices.ppbkuservice/runExList {\"param\":$param} 
  ** Message: serviceResponse Handling: 2, {"errorCode":"ErrorGenericMethodException", "errorText":"Service Method Exception: org.json.JSONException: Missing value at character 9 of {\"param\":}"}
root@castle: cat /tmp/Exclude
  /var/luna/data/Apps/br/config/spds/lastsyncstate_PALMBRW.bin
  /var/luna/data/Apps/br/config/spds/lastsyncstate_PALMBRW_guids.bin
  /var/luna/data/Apps/br/config/spds/lastsyncstate_PALMBRW_luids.bin
  /var/luna/data/CarrierNetworkSettings.db3
  /var/luna/data/dbdata/PalmAccountDatabase.db3
root@castle: cat /tmp/Include 
  /var/luna
  /var/palm/data/browser-cookies.db
  /var/palm/data/file_.usr.palm.applications.com.palm.app.browser_0/0000000000000004.db
  /var/usr/palm/applications
  /var/palm/data
  /usr/palm/applications
  /media/internal/.app-storage
root@castle: cat /tmp/Exclude
  /var/luna/data/Apps/br/config/spds/lastsyncstate_PALMBRW.bin
  /var/luna/data/Apps/br/config/spds/lastsyncstate_PALMBRW_guids.bin
  /var/luna/data/Apps/br/config/spds/lastsyncstate_PALMBRW_luids.bin
  /var/luna/data/CarrierNetworkSettings.db3
  /var/luna/data/dbdata/PalmAccountDatabase.db3
root@castle: luna-send -n 1 palm://com.tntservices.ppbkuservice/runBackup {\"param\":\"99\"}
  ** Message: serviceResponse Handling: 2, {"output":"An error occured with GNU TAR. Palm Pre Backup cannot continue!"}
root@castle:
And as you can see I get an error with GNU TAR when running that last command. Ideas?
Aerode120 is offline   Reply With Quote
Old 11/25/2009, 07:55 PM   #211 (permalink)
Member
 
Join Date: Oct 2009
Posts: 29
Likes Received: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Ok I looked back through at the other commands you gave me and this is what I got:

Code:
root@castle: luna-send -n 1 palm://com.tntservices.ppbkuservice/runExList {\"param\":\"/var/luna\\\\n/var/palm\\\\n/opt/bin\"}
  ** Message: serviceResponse Handling: 2, {"output":"Successfully built list!"}
root@castle: cat /tmp/Exclude 
  /var/luna
  /var/palm
  /opt/bin
root@castle: cat /tmp/Include
  /var/luna
  /var/palm/data/browser-cookies.db
  /var/palm/data/file_.usr.palm.applications.com.palm.app.browser_0/0000000000000004.db
  /var/usr/palm/applications
  /var/palm/data
  /usr/palm/applications
  /media/internal/.app-storage
root@castle: cat /tmp/Exclude
  /var/luna
  /var/palm
  /opt/bin
root@castle: luna-send -n 1 palm://com.tntservices.ppbkuservice/runBackup {\"param\":\"99\"}
  ** Message: serviceResponse Handling: 2, {"output":"An error occured with GNU TAR. Palm Pre Backup cannot continue!"}
root@castle:
Aerode120 is offline   Reply With Quote
Old 11/25/2009, 08:36 PM   #212 (permalink)
Member
 
Join Date: Jul 2009
Posts: 30
Likes Received: 0
Thanks: 5
Thanked 3 Times in 3 Posts
Default

so i had a little bit of time to assess the restored backup

successfully restored:
text messages
web bookmarks
applications (old programs did not replace newer versions)


not restored:
pictures in text messages

thanks again to drewpre !!! i was just about out of time to back up my old phone.
jmelan is offline   Reply With Quote
Old 11/25/2009, 08:57 PM   #213 (permalink)
Member
 
Join Date: Oct 2009
Posts: 29
Likes Received: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Well I copied the file tar file in /var/opt/bin/ to /opt/bin/ and i was able to successfully run a back up and find it on the USB partition. However the app never came back and told me the back up was complete.

One question I ran the command:

Code:
root@castle: luna-send -n 1 palm://com.tntservices.ppbkuservice/runBackup {\"param\":\"99\"}
in command line and the process finished. The 99 file is in the USB partion is that full back up?
Aerode120 is offline   Reply With Quote
Old 11/25/2009, 09:34 PM   #214 (permalink)
Developer
 
rwhitby's Avatar
 
Join Date: Apr 2003
Location: Adelaide, Australia - follow @webosinternals on Twitter visit www.webos-internals.org and www.facebook.com/webosinternals
Posts: 10,220
Likes Received: 546
Thanks: 90
Thanked 8,534 Times in 2,806 Posts
Default

Quote:
Originally Posted by Aerode120 View Post
Ok so I ran 'ls -l /var/opt/bin' and got the following results:
...
But 'ls -l /opt/bin' returns:
/opt/bin should be a bind mount of /var/opt/bin

This means you have not used Preware to install tar, and things are broken as a result.

Remove everything in /var/opt and /opt, and start again, using Preware to install GNU Tar this time.

-- Rod
__________________
WebOS Internals and Preware Founder and Developer
You may wish to donate by Paypal to donations @ webos-internals.org if you find our work useful.
All donations go back into development.
www.webos-internals.org twitter.com/webosinternals facebook.com/webosinternals
rwhitby is offline   Reply With Quote
Old 11/25/2009, 09:45 PM   #215 (permalink)
Member
 
DrewPre's Avatar
 
Join Date: Aug 2009
Location: The HARD Streets of Alpharetta, GA
Posts: 829
Likes Received: 2
Thanks: 44
Thanked 176 Times in 92 Posts
Default

Rod, did you see where he said his /opt/bin only had 4 files?

Didn't that strike you as odd? Do you really think installing Gnu Tar incorrectly would cause that?
DrewPre is offline   Reply With Quote
Old 11/25/2009, 09:49 PM   #216 (permalink)
Member
 
DrewPre's Avatar
 
Join Date: Aug 2009
Location: The HARD Streets of Alpharetta, GA
Posts: 829
Likes Received: 2
Thanks: 44
Thanked 176 Times in 92 Posts
Default

Aerode, I would delete that archive with the 99 in the filename. It was just a test. Besides your exclude list was not built correctly when you made that archive. If you try to restore using it, you will brick your Pre.



Quote:
Originally Posted by Aerode120 View Post
Well I copied the file tar file in /var/opt/bin/ to /opt/bin/ and i was able to successfully run a back up and find it on the USB partition. However the app never came back and told me the back up was complete.

One question I ran the command:

Code:
root@castle: luna-send -n 1 palm://com.tntservices.ppbkuservice/runBackup {\"param\":\"99\"}
in command line and the process finished. The 99 file is in the USB partion is that full back up?
DrewPre is offline   Reply With Quote
Old 11/25/2009, 09:52 PM   #217 (permalink)
Member
 
DrewPre's Avatar
 
Join Date: Aug 2009
Location: The HARD Streets of Alpharetta, GA
Posts: 829
Likes Received: 2
Thanks: 44
Thanked 176 Times in 92 Posts
Default

jmelan, I beleve that to be a quirk of the Chat Messaging App. The pictures in txt msgs will return once you receive txt msgs from the ppl who have missing pix. receiving that txt msg is Chat Messaging's equivalent to a Luna Rescan.



Quote:
Originally Posted by jmelan View Post
so i had a little bit of time to assess the restored backup

successfully restored:
text messages
web bookmarks
applications (old programs did not replace newer versions)


not restored:
pictures in text messages

thanks again to drewpre !!! i was just about out of time to back up my old phone.
DrewPre is offline   Reply With Quote
Old 11/25/2009, 09:54 PM   #218 (permalink)
Developer
 
rwhitby's Avatar
 
Join Date: Apr 2003
Location: Adelaide, Australia - follow @webosinternals on Twitter visit www.webos-internals.org and www.facebook.com/webosinternals
Posts: 10,220
Likes Received: 546
Thanks: 90
Thanked 8,534 Times in 2,806 Posts
Default

Quote:
Originally Posted by DrewPre View Post
Rod, did you see where he said his /opt/bin only had 4 files?

Didn't that strike you as odd? Do you really think installing Gnu Tar incorrectly would cause that?
Yes, the way it should work is that the Optware bootstrap procedure, whether done via the optware-bootstrap.sh script, or by installing the Optware bootstrap package in Preware (which is a dependency of the GNU Tar package), sets up /var/opt/bin and /opt/bin to actually be pointing to exactly the same area on the disk, so modifications in one are automatically mirrored in the other (this is done using a bind mount, but you can think of it as a "directory alias").

So he has installed GNU Tar somehow without doing the optware bootstrap first, and hence the link between those directories hasn't happened.

The root cause I think is that you are distributing manual installation packages instead of just telling people to use Preware to install GNU Tar (this will do the Optware bootstrap automatically), and then use WebOS Quick Install to install the correctly packaged ipkg files.

Getting people to do stuff manually *always* results in inconsistent and incorrect installations, and no easy way to debug them (cause they all turn out slightly different).

-- Rod
__________________
WebOS Internals and Preware Founder and Developer
You may wish to donate by Paypal to donations @ webos-internals.org if you find our work useful.
All donations go back into development.
www.webos-internals.org twitter.com/webosinternals facebook.com/webosinternals
rwhitby is offline   Reply With Quote
Old 11/25/2009, 10:03 PM   #219 (permalink)
Member
 
Join Date: Oct 2009
Posts: 29
Likes Received: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Bootstrap is installed also. GNU Tar would have orginally came from Preware because everything I have done until today involved preware and only preware. I dont actually remember installing it ... I assuming another app neeed it and it was installed then. I can not currently use Preware to install anything because the bottom part of my screen is unresponsive. Hence the reason I need to back up my phone. If there is a way to do it through QI then I can.
Today I installed the GNU Tar from an IPK in the Optware index.

Last edited by Aerode120; 11/25/2009 at 10:10 PM.
Aerode120 is offline   Reply With Quote
Old 11/25/2009, 10:22 PM   #220 (permalink)
Member
 
DrewPre's Avatar
 
Join Date: Aug 2009
Location: The HARD Streets of Alpharetta, GA
Posts: 829
Likes Received: 2
Thanks: 44
Thanked 176 Times in 92 Posts
Default

Quote:
The root cause I think is that you are distributing manual installation packages instead of just telling people to use Preware to install GNU Tar (this will do the Optware bootstrap automatically), and then use WebOS Quick Install to install the correctly packaged ipkg files.
Lesson learneded!!!! ;0)
DrewPre is offline   Reply With Quote
Reply

 

Tags
backup app

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0