November 22, 2024, 02:14:41 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: crontab using for gateway change after every 10 minutes  (Read 4910 times)

Offline modi

  • New Member
  • Posts: 1
crontab using for gateway change after every 10 minutes
« on: February 09, 2008, 06:46:45 PM »
Hi!
Ricky

Long ago i get too much help from you about squid left this forum as i left the field
Again now my son have Q 

Redhat 9 

what is the way to use crontab
For

change gatway router after every five minutes autometically

not by manual command

route add 0.0.0.0 mask 0.0.0.0 192.168.1.2

after five minutes  CRON change it to

route add 0.0.0.0 mask 0.0.0.0 192.168.1.3

thanks for help



Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Re: crontab using for gateway change after every 10 minutes
« Reply #1 on: February 10, 2008, 08:22:03 PM »
So you need to run that command
Add two entries in your cron !
Code: [Select]
0,10,20,30,40,50     *    *    *   *    route add 0.0.0.0 mask 0.0.0.0 192.168.1.2   >> /dev/null 2>&1

Another one :
Code: [Select]
5, 15, 25, 35, 45, 55     *    *    *   *    route add 0.0.0.0 mask 0.0.0.0 192.168.1.3  >> /dev/null 2>&1
That way.. it will change gateway every five minutes.