LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-18-2007, 05:19 AM   #1
aeby
Member
 
Registered: Mar 2007
Posts: 109

Rep: Reputation: 15
running a script from iniittab


Hi ,

I am planning to run a script for example xyz.sh , but i want to do it from inittab, ans put a wait of 30 minutes before the script runs again. can anyone please tell me how to run a script from inittab.


Thanks in advance


BYe
 
Old 05-18-2007, 05:28 AM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
What Linux are you using, and how many times ultimately does the script need to run? Infinitely every half hour, or just twice?
Also, what run-level(s) will the script be run in -- every runlevel, or just multi-user or single-user or... ?
 
Old 05-23-2007, 02:41 AM   #3
aeby
Member
 
Registered: Mar 2007
Posts: 109

Original Poster
Rep: Reputation: 15
Hi
i need to run a script to bqackup files from one branch to another , it should run every 30 mminutes, i want it to run on runlevel 3.

Thanks in advance

Regards
 
Old 05-23-2007, 03:13 AM   #4
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
If that is only on runlevel 3, then indeed /etc/inittab is a handy place to put it in. You'd then put a line about like this (I'm not on Linux ATM):
Code:
ys:3:respawn:sh -c '/path/to/your/script; sleep 30m'
If any runlevel would do, you'd better use cron.

Yves.
 
  


Reply



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
i get an error message running php script inside a cgi script. repolona Linux - Software 0 02-22-2007 09:10 PM
Running a Script sirius56 Linux - Newbie 3 01-02-2007 12:55 PM
running a .sh script bungle3 Linux - Software 3 10-03-2006 08:59 AM
running su from a bash script caminoix Programming 7 12-28-2005 03:41 PM
Running a script spacemonk Linux - Newbie 4 07-30-2004 04:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:02 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
Open Source Consulting | Domain Registration