LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-02-2005, 10:04 PM   #1
skguha
LQ Newbie
 
Registered: Mar 2004
Posts: 21

Rep: Reputation: 15
running scripts automatically


hi,

i have some .sh files which i want to run automatically once i login.....how do i go about this? i am new to linux so pls explain in detail if possible....

thanks a lot

Regards.
 
Old 08-02-2005, 10:19 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 122Reputation: 122
If you're talking about a graphical login, put them in ~/.xprofile. If you're talking about the shell, put them in ~/.bash_profile.
 
Old 08-02-2005, 10:26 PM   #3
mohit dhawan
Member
 
Registered: Mar 2005
Posts: 92

Rep: Reputation: 15
i am not sure
but do u think cron would help

or could u run the progs every time u are abt to log out save the session
and next time when u login the saved session will run..

anyway i will get back with the most apt answer shortly
 
Old 08-02-2005, 11:46 PM   #4
skguha
LQ Newbie
 
Registered: Mar 2004
Posts: 21

Original Poster
Rep: Reputation: 15
thanks for the quick replies.....am using the shell so will check the ~/.bash_profile

if i schedule the jobs with cron then i need to use the command

crontab {filename}

but instead i want the scripts to run when the comp starts.......and keep running until comp shuts down.....

also just wanted to know if i can run them using inittab? if so how? I thot that if i can put it in the file /etc/rc.d/rc3.d then it will run on start up but there doesnt exist any file called rc3.d in the folder /etc/rc.d ....

pls advice.....
 
Old 08-03-2005, 04:11 AM   #5
heema
Senior Member
 
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 47
type:
su
<ur root password>
cp /where u placed it/scriptname.sh /etc/init.d
ln -s /where u placed it/scriptname.sh /etc/rc3.d/S99scriptname
ln -s /where u placed it/scriptname.sh /etc/rc6.d/K99scriptname

Last edited by heema; 08-03-2005 at 04:19 AM.
 
  


Reply


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
Automatically run scripts on startup? Phaethar Fedora 10 09-24-2004 03:35 AM
Automatically load scripts at boot clwhitt Linux - Newbie 2 06-14-2004 12:37 PM
Need help running scripts from scripts sdouble Linux - Newbie 3 05-31-2004 01:56 PM
Automatically running commands azebuski Linux - Newbie 3 02-11-2004 10:36 PM
Where to run scripts automatically on login/logout hilltop*Tech Linux - General 2 02-06-2004 11:59 AM


All times are GMT -5. The time now is 06:59 AM.

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