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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-19-2004, 07:40 PM
|
#1
|
|
LQ Newbie
Registered: Jul 2004
Location: Netherlands
Distribution: Gentoo and SuSE
Posts: 18
Rep:
|
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
|
|
|
|
07-19-2004, 10:09 PM
|
#2
|
|
Member
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519
Rep:
|
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.
|
|
|
|
07-20-2004, 08:00 AM
|
#3
|
|
LQ Newbie
Registered: Jul 2004
Location: Netherlands
Distribution: Gentoo and SuSE
Posts: 18
Original Poster
Rep:
|
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
|
|
|
|
07-20-2004, 11:18 PM
|
#4
|
|
Member
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519
Rep:
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:48 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|