What would be the simplest way to deal with a text file using JSP?
Posted
by Nano Taboada
on Stack Overflow
See other posts from Stack Overflow
or by Nano Taboada
Published on 2008-11-20T16:48:45Z
Indexed on
2010/04/25
6:03 UTC
Read the original article
Hit count: 198
First and foremost I should acknowledge that I have no experience at all using Java ServerPages, but I'm positive about achieving this task if you guys help me out a bit since it doesn't seem like something difficult for a seasoned JSP programmer.
Anyway the thing is, there's an actual running JSP application within a *NIX box which I somewhat administer with kind of good permissions. The idea is to create a new but dead simple JSP page to control some Korn Shell scripts I've got running there. So the goal is to make some sort of HTML form that will be writing some kind of scriptStatus.on / scriptStatus.off file:
#!usr/bin/ksh
# coolScript.sh
# This is my cool script that is being launched by cron every 10 minutes.
if [ -e scriptStatus.off ]
then
# monitor disabled
else
# monitor enabled
fi
which then can be checked for existence within the running script, therefore allowing to easily activate / deactivate it without actually have do deal with cron. Please let me know if all this does make any sense and don't hesitate to ask as much questions as needed.
Thanks much in advance!
© Stack Overflow or respective owner