Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 08-22-2004, 05:32 PM   #1
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?

Old 08-22-2004, 05:35 PM   #2
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, 08:02 PM   #3
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:

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

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



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

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