LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 01-21-2007, 05:37 AM   #1
Black Hawk
Member
 
Registered: Mar 2006
Distribution: Ubuntu 7.10
Posts: 38

Rep: Reputation: 15
How do I run a command at every boot


Hi. How do I run a command every time linux starts?. I want to run it as root.
 
Old 01-21-2007, 05:46 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Depends a bit what you want to do, but you could add a line to crontab such as:

@reboot command_goes_here

using crontab -e as root
 
Old 01-21-2007, 05:50 AM   #3
Black Hawk
Member
 
Registered: Mar 2006
Distribution: Ubuntu 7.10
Posts: 38

Original Poster
Rep: Reputation: 15
I want to start the g15daemon. I'm able to start in manually in the konsole with the command g15 daemon
 
Old 01-21-2007, 06:05 AM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Or you could add the command into /etc/rc.local
 
Old 01-21-2007, 06:21 AM   #5
Hitboxx
Senior Member
 
Registered: Mar 2006
Location: India
Distribution: Fedora
Posts: 1,562
Blog Entries: 3

Rep: Reputation: 68
OR add the command to your*home*folder/.bash_profile if running for certain users.
 
Old 01-21-2007, 12:07 PM   #6
Tischbein
Member
 
Registered: Oct 2006
Distribution: debian
Posts: 124

Rep: Reputation: 15
The cron option is probably the most portable and future proof from what I gather. If "upstart" takes over the init scripts, crontab, at and all the rest of that kludge of commands the crontab interface will still be supported as a front end; so the developers have pledged.

Is there a cron representation for @boot + 5 minutes? I'm just curious. It would help keep boot time down.

Regards, Tintenfisch
 
Old 01-21-2007, 03:13 PM   #7
Black Hawk
Member
 
Registered: Mar 2006
Distribution: Ubuntu 7.10
Posts: 38

Original Poster
Rep: Reputation: 15
Problem solved Thanks
 
Old 01-21-2007, 04:29 PM   #8
Hitboxx
Senior Member
 
Registered: Mar 2006
Location: India
Distribution: Fedora
Posts: 1,562
Blog Entries: 3

Rep: Reputation: 68
Now Black Hawk, we are glad you solved it, but how?? Can you leave the solution here so that others can benefit from it.
 
Old 02-13-2007, 02:04 PM   #9
Black Hawk
Member
 
Registered: Mar 2006
Distribution: Ubuntu 7.10
Posts: 38

Original Poster
Rep: Reputation: 15
I just added "g15daemon" to /etc/rc.local
 
Old 11-16-2008, 09:18 AM   #10
teluguswan
Member
 
Registered: Oct 2005
Posts: 116

Rep: Reputation: 15
Quote:
Originally Posted by Tischbein View Post
The cron option is probably the most portable and future proof from what I gather. If "upstart" takes over the init scripts, crontab, at and all the rest of that kludge of commands the crontab interface will still be supported as a front end; so the developers have pledged.

Is there a cron representation for @boot + 5 minutes? I'm just curious. It would help keep boot time down.

Regards, Tintenfisch

Any one tell where to install the command other than rc.local the above messages said ok do this and that exactly provide the path and filename that will be good.

same i want to put cron job i.e the command

crontab myjobs.cron

myjobs.cron file content is

* 20 * * * halt

daily at 8 in the night my system should shutdown if iam not infront of the system or leave the system. So, where to put the command

crontab myjobs.cron

to run daily

------------------------------------------
 
  


Reply

Tags
at, boot, command



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
cannot run command at boot tuffboynyc Red Hat 2 06-22-2006 12:34 PM
I would like to run a command on boot. Slith(++1) Linux - General 4 04-13-2006 07:08 AM
run command on boot FNC Linux - General 1 11-13-2005 05:29 AM
Run a command at boot Ace2005 Debian 3 07-24-2005 09:09 AM
Run command on boot id10t Red Hat 1 01-28-2004 02:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:53 PM.

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
Open Source Consulting | Domain Registration