Daemon 101


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Daemon 101
# 1  
Old 05-17-2007
Daemon 101

I think I have an issue almost like Sammy_T's. I want to make a piece of code run as a daemon. I have some java, along with it 15 classpath's converted to a shell script that I can "runmyjavap". The script is just what I need to run after compiling it:

#!/bin/sh
java -classpath : ...(from here all my classes and ends with my java file name)

I can cron this thing and run it as a cronjob every half hour, because it's just renaming files based on requests. But I found out earlier that the request might be coming in very frequently like every minute. From what I read on a daemon I think it could solve my problem, if I could have one that sleeps every other minute and handles this. But I am clueless as how to and where in my shell script to add this implementation. Please help me understand if you can.
# 2  
Old 05-17-2007
Miller,
Try this:
Code:
while true
do
  java -classpath..............
  sleep 60          ### This is the number of seconds.
done

# 3  
Old 05-17-2007
I will give this a shot...thanks!!!
# 4  
Old 05-17-2007
Quote:
Originally Posted by Miller_K
because it's just renaming files based on requests.
How do the requests arrive? Can you not wake up your application based on an IPC event?
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash 101 - to (do) ; or not to (do) ; ?

I figured this forum needs some laughs , so I am posting this. And if the answer is - it depends on bash version - do not reply. This is from "manual" while CONTROL-COMMAND; do CONSEQUENT-COMMANDS; done And here is the REAL code - no ";" while do xterm & i=$ done (2 Replies)
Discussion started by: annacreek
2 Replies

2. UNIX for Dummies Questions & Answers

Help Me please scripting 101

Hi, I had to pull a handful of account numbers from a file into a table. Now I want to do a basic list from a directory in my program showing me if any files for these customers exist. There are files associated with each client and need to be processed individually. $Paytos = 00153301 00153302... (5 Replies)
Discussion started by: ski
5 Replies

3. UNIX for Dummies Questions & Answers

NOQUEUE: low on space ( have 0, SMTP-DAEMON needs 101 in /var/spool/mqueue)

hi, I'm in Solaris 2.8 env. When i'm trying to add a ftp user account , encountered "no space in disk" .. couldn't create any user. Then check the fs disk space with "df - k " and /var/adm/syslog .. got the below message. Jun 9 03:10:53 mail sendmail: NOQUEUE: low on space (have 0,... (10 Replies)
Discussion started by: Dolly
10 Replies
Login or Register to Ask a Question