Start and stop script - - UNIX /Solaris
Can someone tell me the easiest way to automate start and stop of an event on a Unix (Solaris)?
Example: If I want application X to start at 11.00 PM and stop at 02.00 AM.
Thanks, Dan
Linux
Can someone tell me the easiest way to automate start and stop of an event on a Unix (Solaris)?
Example: If I want application X to start at 11.00 PM and stop at 02.00 AM.
Thanks, Dan
by cavedweller
by dan_42
by ca_rlittle
If you want to start and stop something at a particular time on a regular basis you should use the cron facility. I suggest writing a shell script that wraps the starting and stopping of the program. This allows you to control environment variables and debugging. If you want to do this only once, then I suggest the at facility.
If you want to do this at startup/shutdown, then you should use the /etc/rc3.d directory scripts. For examples of how this works, see the /etc/rc2.d directory scripts. All script beginning with a 'S' are executed on startup. Those beginning with a 'K' are executed on shutdown.
If you want a program to always be running, and restarted if it crashes, then you can look at the /etc/inittab file.
All of these facilities can be found in the man pages.
by dan_42
Hi,
just write a little script that will accept 3 parameters:
1- name of the application
2- starting time
3- ending time
the script will issue an "at" command for
param #1 at the time #2 and issue a 2nd
"at" command doing a kill -9 of the process
number at ending time specified by param #3
hope this is what you are trying to do.
by dan_42
by dan_42
This discussion is closed to new replies.
Sort by Trending