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 07-19-2004, 08:40 PM   #1
jeroenvrp
LQ Newbie
 
Registered: Jul 2004
Location: Netherlands
Distribution: Gentoo and SuSE
Posts: 18

Rep: Reputation: 0
Question Only starting command in a specific time period


Hi,

How do one starts a command after the time and date mets a specific condition.

Example:

- I'm booting Linux and it's starting all the processes in the various runlevels.
- There is one proccess (command) that must only start on saturday, sunday and monday night, during 18h00 and 23h00 .
- So it checkes the time and if it's for instance saturday evening 22h10 it will start command A. If it's for instance Wednesday afternoon 14u30 the command B will start.

So i'm not talking about the 'at' command and also not about 'cron'.

Hopefully someone can helps me with this issue. Personally I think it can be done with a little bit of shell-scripting, but I don't know how and searching Google gives to much results.

Cheers,

Jeroen
 
Old 07-19-2004, 11:09 PM   #2
osvaldomarques
Member
 
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519

Rep: Reputation: 34
Hi jeroenvrp,
I think you are talking about cron. If you read the manual for crontab, which is the front end for cron, you will see that you can specify a minute, hour, day of week, day of the month and month to precisely start your job, if your machine is running at the time. The at command is to specify one delayed job. Cron is to specify cyclic executions of the same job.
 
Old 07-20-2004, 09:00 AM   #3
jeroenvrp
LQ Newbie
 
Registered: Jul 2004
Location: Netherlands
Distribution: Gentoo and SuSE
Posts: 18

Original Poster
Rep: Reputation: 0
Thank you for your answer, but this is not a cron issue unfortunately.

The command is in the crontab on 18h00 (it switch off internet-access):
- This works great when the PC is on, but when the PC is off or the PC is rebooted after 18h00 the Internet access will be restored, because it's in the default boot sequence (init.d).
- So I want to run this command (to switch off internet-access) when the PC is booted between 18h00 and 23h00.

If cron has an option while it starts on boot to run not-performed tasks, it would be great, but according my knowledge it's not possible.

Cheers,

Jeroen
 
Old 07-21-2004, 12:18 AM   #4
osvaldomarques
Member
 
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519

Rep: Reputation: 34
Code:
* 18-23 * * sat-mon check-internet-connection >/dev/null 2>&1
This crontab will run the "check-internet-connection" every minute in the range. It may be a script to check "ps ax | grep -c apache" to see if it is running and kill it if needed. Depending on the way the script is written it won´t load for instances you already have internet down and your computer will be glad to serve you.
 
  


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 10:47 PM
Slackware IP resolution time period problem phoenixx Linux - Distributions 5 05-11-2005 08:36 PM
bit rate drops after period of time The_JinJ Linux - Wireless Networking 5 03-21-2005 02:21 PM
Running a program for a specific period of time CaptainHowdy Linux - Software 2 08-22-2004 08:02 PM
starting X from the command line in a specific resolution jdaniel Linux - General 5 09-10-2003 10:25 PM


All times are GMT -5. The time now is 11:46 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration