Run shell script as a daemon

I have simple shell script that I run as cron job every hour of the day. I would like to make it a daemon that runs far more frequently like every 30 seconds or so, but I have never made daemon before. How can I do this?

-Sam

Sam,
Use "cron".
In unix, do a man page to it:
man cron

Sure,

I would like to keep using cron, but will I be able to run a cron job say every minute at least. I was always under the impression that running a cron job in intervals under 5 minutes was not the best practice. Please advise because I could really be wrong.

Or use something like this:

while :;do
	# your code here
	sleep 30
done

Should I insert that example code into my java program or add it to my shell script which runs the java program?

This is shell syntax so you cannot put it in your java code.
If you know java - write it all in java, if not - write a shell wrapper.

Having any program wake up after only a few seconds and do something is bad-practice. It is far better for a program to wake up as a result of a specific event (signal, file descriptor read, semaphore etc).

If you really must then kick it down in priority with nice.

The program would be awakening a checking for "list of worK". If it meets the programs criteria, it will run a method against it and move it to the next level of processing which it is not responsible for. So having it run more frequently ensures that the user does not have to wait at least 5 minutes, because the program executes quicly when it does run.