LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-22-2004, 04:32 PM   #1
CaptainHowdy
LQ Newbie
 
Registered: Aug 2004
Posts: 8

Rep: Reputation: 0
Running a program for a specific period of time


Hello everybody!

i want to run a program for a specific period of time. Specifically,
i want to run overnet from 23.00 at night to 6.00 am in the
morning. I ve seen the crontab command but i didnt find
any switch to specify to tha command the amount of period
of time to run.

Anyone has any ideas?

thanx
 
Old 08-22-2004, 04:35 PM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Either the program itself needs to be able to check the time, or you need to issue a start and a stop command, which could just be a kill pid via a second cron job.
 
Old 08-22-2004, 07:02 PM   #3
shengchieh
Member
 
Registered: Jul 2004
Location: Palo Alto, CA
Distribution: #! Korora
Posts: 472

Rep: Reputation: 30
Maybe others can help. But here's an idea.
Btw, figure out the options to use. I'm only
giving an idea.

Create an infinite do loop script:

Loop:
iflag = 0
date -option??? | grep -option??? > $TODAYTIME
if $TODAYTIME > 3pm & iflag = 0 then (you choose the time)
<run program>
iflag = 1
endif
if $TODAYTIME = 12am then
iflag = 0
endif
end of loop

So $TODAYTIME has the time. iflag = 1 if program is ran for
that day, otherwise zero.

Sheng-Chieh
 
  


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
MPlayer: Recording specific time period of audio stream nazarioz Linux - Newbie 7 06-02-2005 09:47 PM
run program automatically at specific time simon_qwl Programming 2 03-20-2005 10:58 AM
quit program after a specific time (prob. BASH) bglnelissen Linux - General 2 01-25-2005 01:22 AM
Only starting command in a specific time period jeroenvrp Linux - Software 3 07-20-2004 11:18 PM
Running a program for a specified time Brett-NZ Linux - Newbie 4 12-08-2002 05:48 PM


All times are GMT -5. The time now is 05:15 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration