-
Opening a terminal in mac and then executing a command on it
Hi Guyz,
What i am trying to do here is through a jsp page - open a terminal and then run a mysqldump on that terminal, all from the jsp page. Well i got a lot of documentation of doing the same in Windows using the cmd.exe but couldnt find one for doing the same for a mac.
this is my code so far :-
Runtime rt = Runtime.getRuntime();
Process p = rt.exec("Open /Applications/Utilities/Terminal.app");
-
You want to open a terminal from a jsp page? I don't think it's going to let you do that, and if it does it probably shouldn't. Unless I'm missing something it sounds you could just run mysqldump directly through exec().
-
Hi cybertron,
You are right and that is exactly what i wanted to do ultimately, execute the mysql dump. but the command doesnt do it for some reason. For eg
Runtime rt = Runtime.getRuntime();
Process p = rt.exec("mysqldump -h000.000.000.000 -uabc -pxyz database client > ~/desktop/cli.txt
-
Originally Posted by nisargz
Hi cybertron,
You are right and that is exactly what i wanted to do ultimately, execute the mysql dump. but the command doesnt do it for some reason. For eg
Runtime rt = Runtime.getRuntime();
Process p = rt.exec("mysqldump -h000.000.000.000 -uabc -pxyz database client > ~/desktop/cli.txt
Not sure if you typed the command exactly, but your missing a ');' at the end.
That might help with execution.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|