Hi How to i make this to start automatically 5 * * * * /opt/jdk1.5.0_06/bin/java -jar /path/to/jwwim_server_sql2.jar localhost web1_db4 PASSWORD 5190 -l Thanks.
You realise that will run at 5 past every hour? If you mean you want it to start when the box is restarted then some versions of cron (such as Redhat) support @reboot so your crontab entry would be @reboot /opt/jdk1.5.0_06/bin/java -jar /path/to/jwwim_server_sql2.jar localhost web1_db4 PASSWORD 5190 -l
If you want to start it at boot time, you simply create a script like /etc/init.d/jwwim_server_sql2: Code: #!/bin/bash /opt/jdk1.5.0_06/bin/java -jar /path/to/jwwim_server_sql2.jar localhost web1_db4 PASSWORD 5190 -l Then run Code: chmod 755 /etc/init.d/jwwim_server_sql2 and create the necessary system startup links. Depending on your distribution you can do it with chkconfig (RedHat, Fedora, CentOS, Mandriva, SuSE) or update-rc.d (Debian, Ubuntu).
Can any program be made to run at startup? for example: a teamspeak server, and a counter strike server. As long as i use the startup commands for the respective servers, in the code?
will the above run the commands as root ? is there a way to create a delay ? i need to start 2 programs and the first must be already started when the second starts. i hope this works for centos 5 !
Yes. You can either use the sleep command (see Code: man sleep ), or create two cron jobs where the second one is executed after the first one.