Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-20-2006, 12:12 AM   #1
Registered: Oct 2005
Location: Bangladesh
Posts: 471

Rep: Reputation: 30
Question Run script automatically

Friends ,

I am using Redhat Enterprise Linux 4 server . I have written a SCRIPT
into my server . Now I want a situation ,

my "script" is running automatically when my pc is restarting . i.e.,How I can run my script automatically everytime when I reboot
my pc .
Old 08-20-2006, 12:34 AM   #2
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
put something like this in your /etc/rc.local file

sh /path/to/your/script
Old 08-20-2006, 01:13 AM   #3
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Another, fairly simple way is yo add a line to crontab

@reboot /your/file/to/run


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Run shell script as root automatically elempoimen Linux - Software 8 06-20-2010 02:24 AM
RH8 - how to automatically run a shell script at boot time nu-B Linux - Newbie 2 11-03-2003 03:47 PM
RH8 - how to automatically run iptables rules shell script at boot time nu-B Linux - General 1 10-29-2003 09:38 PM
How do I automatically run at boot an X program or script cmisip Linux - General 4 01-05-2003 07:30 PM
How can the linux OS run script automatically at startup? tommylkc Linux - Newbie 1 06-26-2002 04:09 AM

All times are GMT -5. The time now is 07:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration