Foros Linux Argentina
Febrero 07, 2012, 06:56:37 *
Bienvenido(a), Visitante. Por favor, ingresa o regístrate.
¿Perdiste tu email de activación?

Ingresar con nombre de usuario, contraseña y duración de la sesión
 
   Inicio   Ayuda Buscar Ingresar Registrarse  
Páginas: [1]   Ir Abajo
  Imprimir  
Autor Tema: Problema funcionamiento cron  (Leído 3498 veces)
garvarma
Visitante


Email
« : Noviembre 03, 2006, 04:35:28 »

Hola a todos,

tengo hecho el siguiente script con linux debian:

#!/bin/sh

#cambio3=0 # 0-->no ha caido la interfaz
#cambio4=0 # 0-->no ha caido la interfaz
cont3=0
cont4=0
Red3=192.168.3.1
Red4=192.168.4.1

if `ping -c 1 $Red3> /dev/null` ;then cont3=$[$cont3+1]; fi
if `ping -c 1 $Red3> /dev/null` ;then cont3=$[$cont3+1]; fi
if `ping -c 1 $Red3> /dev/null` ;then cont3=$[$cont3+1]; fi
if `ping -c 1 $Red3> /dev/null` ;then cont3=$[$cont3+1]; fi
if `ping -c 1 $Red3> /dev/null` ;then cont3=$[$cont3+1]; fi
if `ping -c 1 $Red3> /dev/null` ;then cont3=$[$cont3+1]; fi
if `ping -c 1 $Red3> /dev/null` ;then cont3=$[$cont3+1]; fi
if `ping -c 1 $Red3> /dev/null` ;then cont3=$[$cont3+1]; fi
if `ping -c 1 $Red3> /dev/null` ;then cont3=$[$cont3+1]; fi
if `ping -c 1 $Red3> /dev/null` ;then cont3=$[$cont3+1]; fi
echo $cont3
if [ $cont3 -ge 7 ]; then
#if `ping -c 10 $Red3> /dev/null` ;then
        echo $Red3:ENCENDIDO
        if [ `more /etc/init.d/EstadoLAN3.fl` -eq 1 ]; then
#               ip route add 192.168.3.0/24 dev eth1 proto static src 192.168.3.2
                ip route chg default proto static equalize nexthop via 192.168.3.1 dev eth1 weight 1 nexthop via 192.168.4.1 dev eth3 weight 1
                echo 0 > /etc/init.d/EstadoLAN3.fl
                echo HA CAIDO LA ? Y HA VUELTO
        else
                echo HOLAAAAAAA NO CAMBIOOOSS
        fi
else
        echo 1 > /etc/init.d/EstadoLAN3.fl
#       ip route flush 192.168.3.0/24 dev eth1
        ip route chg default proto static nexthop via 192.168.4.1 dev eth3
        echo $Red3:APAGADO
fi


El script me dice si una red esta muerta o no.

a la hora de enlazar el script con el cron para que se ejecute cada minuto, tengo puesto esto en el crontab -e:

proxy:/etc/init.d# crontab -l
# Definicion timer ejecutar script rutas-muertas
#1-59 * * * * /etc/init.d/CONTADOR > i.txt
*/1 * * * * root /etc/init.d/prueba.sh

y el crontab no funciona correctamente, como mucho me lo ejecuta el primer minuto y ya esta y los dem?s nada de nada.

que alguien me ayude por favor!

muchas gracias
En línea
section
Visitante


Email
« Respuesta #1 : Diciembre 26, 2007, 09:02:04 »

hola  que tal

proba con

* * * * * root /etc/init.d/prueba.sh

creo q tendria q ejecutarse cada un minuto

espero q te ande saludos
En línea
Foros Linux Argentina
   

 En línea
Páginas: [1]   Ir Arriba
  Imprimir  
 
Ir a:  

Impulsado por MySQL Impulsado por PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC
SMFAds for Free Forums
XHTML 1.0 válido! CSS válido!