Run shell commands via HTML webpage/button?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run shell commands via HTML webpage/button?
# 1  
Old 06-19-2007
Question Run shell commands via Iplanet HTML webpage/button?

Hey guys,

I got a issue here...

we have a development box and a UAT box that our webmasters use, they do the webpage development on the development box and and save changed files to a particular directory on the dev machine.

At a certain time of the day a cronjob kicks off and the development directory containing the changed files are "rsynced" with the UAT box.

now here is the dilema, the files are being changed much more frequently now and the single scheduled rsync is not keeping up with the amount of changes, so the webmaster are contacting us to manually run the rsync so they can see there changes in UAT.

Normally, I would just give them access to a restricted shell script that they could run themselfs at the command line that would kick off the rsync job. However, most of them are not familar/comfortable with Unix CLI --or just dont want to get involved with doing that.

So, with all that being said -- is there a way i could create a simple HTML page with button them could "click" that would execute the rsync command?

I know most web server development has been geared towards NOT allowing this type of interaction....

here is the command we run

00 18 * * 5 /usr/bin/rsync -aWvz -e ssh --delete --progress --safe-links /local/apps/iplanet/servers/docs/someserver.xyz.com/ webuser@someserver:/local/apps/iplanet/servers/docs/ > /local/home/webuser/rsync.out 2>&1

Solaris 8


thanks for any help guy

Last edited by zeekblack; 06-19-2007 at 12:25 PM..
# 2  
Old 06-19-2007
Quote:
Originally Posted by zeekblack
So, with all that being said -- is there a way i could create a simple HTML page with button them could "click" that would execute the rsync command?

Take a look at http://cfaj.freeshell.org/testing/ for an example of running a command from a web page.

# 3  
Old 11-10-2008
Hello Chris,
Prolly a little late with my query here but going through the source code i could not make out how u are calling the shell or cgi script. I mean there should be some kind of an event or action listener that calls the cgi script and displays the date in the new page.
My problem is I have an HTML page in which I would want to embed a tag or button which can call shell script on my server.
# 4  
Old 11-10-2008

I use a link to the script:

Code:
<a href="date.cgi">date.cgi</a>

Or I put it in a form:

Code:
 <form action="date.cgi">
  <p style="margin: 2em 20%;">
    <input type="submit" value="DATE" >
  </p>
 </form>

And embed it in the page with a server-side include:

Code:
    <pre>
    <!--#include virtual="date.cgi" -->
    </pre>

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Launch shell script with parameters from a webpage button

I want to create a simple html page that should contain 2 fields in which the user can write the input. Then I want to have a button that should launch a shell script with the parameters inserted by user in the fields from the webpage. This is the code behind my webpage: <html> <form... (2 Replies)
Discussion started by: black_fender
2 Replies

2. Web Development

Get command-output to webpage from solaris-10-OS invoked from html webpages

Hello, I am a middleware administrator and as an admin I need to monitor a number of middleware instances (weblogic servers). But since it is a not the forum for that i would like to put my problem in simple terms and need guidance on that. I need to use apache webserver on Solaris 10 zones to... (3 Replies)
Discussion started by: poga
3 Replies

3. Shell Programming and Scripting

html/bash button

Hello everyone I am writing a cgi script in bash/html. I am trying something new with this one I have seperated the html code from the scripting. The html code is found in text files on the drive and the scripting is only one script in the cgi bin and i am using "<select multiple name="state"... (3 Replies)
Discussion started by: wlane7878
3 Replies

4. OS X (Apple)

Geek Tool Shell Commands in HTML

I'm new around these parts but I figured I might as well ask something thats been bothering me for a while. I have a little HTML experience and really none at all with unix. I have been running a geektool-a preference pane that outputs shell commands onto the desktop for Mac. Recently I have been... (5 Replies)
Discussion started by: neroyalty
5 Replies

5. UNIX for Advanced & Expert Users

shellinabox/html help to insert a keypress with an html button

I am trying to use shellinabox as a terminal emulator. Everything is working except there seems to be no way to simulate an F14 button press in shellinabox. I am already embedding shellinabox in an html page so Im am wondering if there is a way to make an html/js button that will pass F14 to the... (0 Replies)
Discussion started by: syadnom
0 Replies

6. Shell Programming and Scripting

Run Shell Commands via HTML on a client machine

Hi guys, so, I have a server running an sqlite database which is accessed by many client machines working as hardware testers, whenever something fails and needs to be replaced the operator would have to enter the Serial Number of the part being replaced as well as some other data. and... (0 Replies)
Discussion started by: sx3v1l_1n51de
0 Replies

7. Shell Programming and Scripting

Run a shell script from one host which connext to remote host and run the commands

I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies

8. Shell Programming and Scripting

need help with html button

Hello everyone, I am trying to implement an html button that will call a script and pass two arguments "perl script.pl website.com 1" this is for a search results page on a php spider called "sphider". the variable $url? is the url and Than needs to be one of the arguments in calling the script.... (0 Replies)
Discussion started by: mike171562
0 Replies

9. Shell Programming and Scripting

How to run unix commands in a new shell inside a shell script?

Hi , I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell. So scenario is that - I need to have one shell script which is ran as a part of crontab - in this shell script I need to do a... (2 Replies)
Discussion started by: hkapil
2 Replies

10. UNIX for Advanced & Expert Users

which access right should set in my webpage index.html ?

I have a webpage, http://my.dns.com/~zp523/index.html, I want all people to have read and execute privileges. I want to extend it with execute privilege. Which command should be used in chmod? is it only give read(r) & execute(x) parameter in 'chmod ??? index.html' thk a lot!! (1 Reply)
Discussion started by: zp523444
1 Replies
Login or Register to Ask a Question