Start Up Scripts

sean.ferguson

OSNN Veteran Addict
Joined
4 Jul 2003
Messages
1,693
How can I write a script that will run a program ( ~/folding/FAH502 ) everytime the server boots up.

I know that cronjobs can run things at a certain time, but my server isnt important enough to warrant purchasing a UPS so when we have a powercut i need to run around and restart all my running apps. Is there a way I can put these in a script that can be run on system boot?

Ideally I would like a screen session to be opened first, and then the program in question ran. That way I can manage the progress etc remotely without needing local access to the machine.
 
Last edited:
Depending on the linux flavour of the week, create a script in either:

/etc/init.d
/etc/rc.d
/etc/runlevel.d

Or if it is FreeBSD:

/usr/local/etc/rc.d

And just prepend the command to be run by a "screen" and it will be executed in a screen.
 
Thanks X, the flavour is Slackware 10.2 and I have just been speaking to someone on YIM who has said that there is a crontab special flag "@reboot" - I wasn't aware of such flags.

So in that case I have just added the following line to my users crontab

Code:
@reboot screen -d -m ~/folding/FAH504-Linux.exe

I'l have a look at those files also though, just to make myself familiar
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,623
Latest member
AndersonLo
Back