Hi all. im having some problems trying to use crontab or cron.d. I want to run a shell script-1 from 7:00 pm to 11:00 pm, and then run the shell script-2 from 11:01pm to 6:59 pm. Does anyone know how to do this? Thanks a lot.
Cristiano.
Am Mo, den 28.06.2004 schrieb Cristiano Soares um 20:22:
Hi all. im having some problems trying to use crontab or cron.d. I want to run a shell script-1 from 7:00 pm to 11:00 pm, and then run the shell script-2 from 11:01pm to 6:59 pm. Does anyone know how to do this? Thanks a lot.
Cristiano.
man 5 crontab
*/5 19-22 * * * script-1 */5 0-18,23-0 * * * sctipt-2
Alexander
At 12:22 PM 6/28/2004, Cristiano Soares wrote:
Hi all. im having some problems trying to use crontab or cron.d. I want to run a shell script-1 from 7:00 pm to 11:00 pm, and then run the shell script-2 from 11:01pm to 6:59 pm. Does anyone know how to do this? Thanks a lot.
Scripts don't run for four hours and then stop... they run until they finish and then stop. You cannot control which script is currently running with cron; that is, you cannot *stop* a script with cron, you can only start it. Do you want the script to be run *every single minute*? How often do you want the script to be started?
Cheers,
Am Mo, den 28.06.2004 schrieb Alexander Dalloz um 20:38:
*/5 19-22 * * * script-1 */5 0-18,23-0 * * * sctipt-2
Sorry, second line must be
*/5 0-18,23 * * * script-2
The scripts are running every 5 minutes, every day.
Alexander
P.S. Please don't post HTML formatted mail to the list, just plain text.
----- Original Message ----- From: Cristiano Soares To: fedora-list@redhat.com Sent: Monday, June 28, 2004 7:22 PM Subject: crontab or crond
Hi all. im having some problems trying to use crontab or cron.d. I want to run a shell script-1 from 7:00 pm to 11:00 pm, and then run the shell script-2 from 11:01pm to 6:59 pm. Does anyone know how to do this? Thanks a lot.
Cristiano.
Hi Cristiano
You didn't specify how many times you wanted it to run during those times. If you let me know I'll bash out a crontab for you no worries!
One of the other things you might want to think about is whether you need it logged or not. My email crontab runs every 5 minutes and does get logged so that I can track down problems, you might not want it to, however I find it handy for nailing transcient problems or users trying to jam 10MB through.
So let me know how often and I'll send it across to you.
Bry
-- fedora-list mailing list fedora-list@redhat.com To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
On Mon, 2004-06-28 at 12:39 -0600, Rodolfo J. Paiz wrote:
At 12:22 PM 6/28/2004, Cristiano Soares wrote:
Hi all. im having some problems trying to use crontab or cron.d. I want to run a shell script-1 from 7:00 pm to 11:00 pm, and then run the shell script-2 from 11:01pm to 6:59 pm. Does anyone know how to do this? Thanks a lot.
Scripts don't run for four hours and then stop... they run until they finish and then stop. You cannot control which script is currently running with cron; that is, you cannot *stop* a script with cron, you can only start it. Do you want the script to be run *every single minute*? How often do you want the script to be started?
Well, if they are scripts that loop indefinitely could use one cron entry to start the script at the beginning of the interval and another to kill it at the end. Look at scripts in /etc/init.d for examples of dealing with PIDs.
Another interpretation of the question could be that you want one or the other available during the period. That could be done by a cron sequence of "ln -fs script-1 script-name", "ln -fs script-2 script- name", "rm -f script-name".
Need to clarify the question.
Phil
Hi. Thanks for the reply. Here is my situation:
I have a server that has a HTB shaper running and my HTB scripts are called rc.filter and rc.filter2. The first one(rc.filter) has all ports opened, and the second one(rc.filter2) has the e-donkey and bittorrent ports closed(4661, 4661, 8668, ....). What I want to do is to run the first script(rc.filter) from 12:00am to 7:00pm so anyone can download and uso anything during that time, and run the second script(rc.filter2) from 7:01 to 11:59(the rest of the day), so people wont kill the bandwidth at the point that others cant even browse. Thanks in advance.
Cristiano
----- Original Message ----- From: bryan@redfedora.co.uk To: "For users of Fedora Core releases" fedora-list@redhat.com Sent: Monday, June 28, 2004 3:55 PM Subject: Re: crontab or crond
----- Original Message ----- From: Cristiano Soares To: fedora-list@redhat.com Sent: Monday, June 28, 2004 7:22 PM Subject: crontab or crond
Hi all. im having some problems trying to use crontab or cron.d. I want to run a shell script-1 from 7:00 pm to 11:00 pm, and then run the shell script-2 from 11:01pm to 6:59 pm. Does anyone know how to do this? Thanks
a
lot.
Cristiano.
Hi Cristiano
You didn't specify how many times you wanted it to run during those times. If you let me know I'll bash out a crontab for you no worries!
One of the other things you might want to think about is whether you need
it
logged or not. My email crontab runs every 5 minutes and does get logged
so
that I can track down problems, you might not want it to, however I find
it
handy for nailing transcient problems or users trying to jam 10MB
through.
So let me know how often and I'll send it across to you.
Bry
-- fedora-list mailing list fedora-list@redhat.com To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
-- fedora-list mailing list fedora-list@redhat.com To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
Am Di, den 29.06.2004 schrieb Cristiano Soares um 2:23:
Hi. Thanks for the reply. Here is my situation:
I have a server that has a HTB shaper running and my HTB scripts are called rc.filter and rc.filter2. The first one(rc.filter) has all ports opened, and the second one(rc.filter2) has the e-donkey and bittorrent ports closed(4661, 4661, 8668, ....). What I want to do is to run the first script(rc.filter) from 12:00am to 7:00pm so anyone can download and uso anything during that time, and run the second script(rc.filter2) from 7:01 to 11:59(the rest of the day), so people wont kill the bandwidth at the point that others cant even browse. Thanks in advance.
Cristiano
So you have 2 events. Please read "man 5 crontab" - it contains all the information you need. Execute rc.filter at 12:00am and rc.filter2 at 07:01pm.
Alexander
On Mon, Jun 28, 2004 at 03:22:59PM -0300, Cristiano Soares wrote:
Hi all. im having some problems trying to use crontab or cron.d. I want to run a shell script-1 from 7:00 pm to 11:00 pm, and then run the shell script-2 from 11:01pm to 6:59 pm. Does anyone know how to do this? Thanks a lot.
Does the second script depend on the first being finished?
Does the first need to be killed at 11:01 and does the second need to be killed at 6:59 (AM not pm I think).
Can they overlap by a min or two?