LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2004, 10:23 AM   #1
lionking_x
Member
 
Registered: Aug 2003
Posts: 36

Rep: Reputation: 15
Cron Problem !!!


Hi ALL ,

I was doing a practice exam for RHCE , and one of the questions was

"Set up networking only during working hours ( 8:00 AM to 5:00 PM) "

How can i do this ? there is no more explanation given . The author of the exam says that
"You can limit networking to working hours using appropritae cron jobs from /etc/cron.daily"

Any ideas ??

thanks
 
Old 12-13-2004, 10:35 AM   #2
adamwenner
Member
 
Registered: Aug 2003
Distribution: windows xp home, windows 98, red hat 9, fedora core 3, redhat enterprise linux, win2000 pro/server
Posts: 217

Rep: Reputation: 32
i would use crontab to do it

this should help you

http://www.adminschoice.com/docs/crontab.htm


good job on the RHCE, im only an RHCT, hopefully someday ill be RHCE, then again, im only 18

ttyl

--adam
 
Old 12-13-2004, 10:45 AM   #3
lionking_x
Member
 
Registered: Aug 2003
Posts: 36

Original Poster
Rep: Reputation: 15
Hi
i have used crontab for many other tasks ,
WHAT do i SPECIFICALLY do to disable networking ??? some service ? can you be more specific please ?

thanks for your help man ,



Quote:
Originally posted by adamwenner
i would use crontab to do it

this should help you

http://www.adminschoice.com/docs/crontab.htm


good job on the RHCE, im only an RHCT, hopefully someday ill be RHCE, then again, im only 18

ttyl

--adam
 
Old 12-13-2004, 01:13 PM   #4
lionking_x
Member
 
Registered: Aug 2003
Posts: 36

Original Poster
Rep: Reputation: 15
OK OK , can i use iptables , but i think this is not the rightway to get to it though ,

Write a shell scripts to disable my output policy say at 8 am,

"iptables -P OUTPUT DROP "

and then enable it back at 5pm

"iptables -P OUTPUT ACCEPT"

I can have two crontab entries to do this, one at 5pm and the otherone at 8am.

I know this will work , but is there an easier way ??



Quote:
Originally posted by lionking_x
Hi
i have used crontab for many other tasks ,
WHAT do i SPECIFICALLY do to disable networking ??? some service ? can you be more specific please ?

thanks for your help man ,
 
Old 12-13-2004, 01:18 PM   #5
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
I'm not sure about RedHat, but gentoo has some scripts in /etc/init.d.

I would do:

"/etc/init.d/net.eth0 stop"

and then

"/etc/init.d/net.eth0 start"

To take down and up the ethernet interface.
 
Old 12-13-2004, 01:42 PM   #6
lionking_x
Member
 
Registered: Aug 2003
Posts: 36

Original Poster
Rep: Reputation: 15
Hi ,

sure you can do this with redhat , you can disable the eth0 card , infact the entire "network" service which might involve all the network cards including the loopback card too, lo .

I sure thought abt this ,dont know why i did not use this solution , cant think of the reason now.

thanks , its a low grading question, so this must be it.

Thanks








Quote:
Originally posted by visaris
I'm not sure about RedHat, but gentoo has some scripts in /etc/init.d.

I would do:

"/etc/init.d/net.eth0 stop"

and then

"/etc/init.d/net.eth0 start"

To take down and up the ethernet interface.
 
Old 12-13-2004, 04:36 PM   #7
adamwenner
Member
 
Registered: Aug 2003
Distribution: windows xp home, windows 98, red hat 9, fedora core 3, redhat enterprise linux, win2000 pro/server
Posts: 217

Rep: Reputation: 32
service network stop will disable all networking interfaces
 
  


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
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
cron problem... wrongman Linux - Software 3 06-06-2004 01:21 PM
Cron problem vasco1984 Linux - Software 5 11-22-2003 11:07 AM
[cron][mdk9.1]cron deamon seems to ignore some task... yannrichet Linux - Newbie 5 06-26-2003 09:57 AM
dual entries in cron log for cron.daily cpharvey Linux - General 3 02-27-2003 02:30 PM


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