Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
How can i run shell script at boot (start up)

I have .sh script to run my game server with mono. I need run this command on the boot

sh script.sh start

How do it?

share|improve this question

marked as duplicate by Chris S Sep 27 '12 at 1:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

Put it into /etc/rc.local:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

sh /path/to/script.sh start

or in a cron job with a special activation parameter:

crontab -e
@reboot /path/to/script.sh start
share|improve this answer
    
I believe it is meant to be /etc/rc.local. –  senorsmile Sep 26 '12 at 22:15
    
@senorsmile: thanks, just a typo. –  quanta Sep 26 '12 at 22:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.