Foros Linux Argentina
Febrero 07, 2012, 06:56:37
Bienvenido(a),
Visitante
. Por favor,
ingresa
o
regístrate
.
¿Perdiste tu
email de activación?
1 Hora
1 Día
1 Semana
1 Mes
Siempre
Ingresar con nombre de usuario, contraseña y duración de la sesión
Inicio
Ayuda
Buscar
Ingresar
Registrarse
Foros Linux Argentina
>
Foro Linux
>
Seguridad
>
Problema funcionamiento cron
Páginas: [
1
]
Ir Abajo
« anterior
próximo »
Imprimir
Autor
Tema: Problema funcionamiento cron (Leído 3498 veces)
garvarma
Visitante
Problema funcionamiento cron
«
:
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
Re: Problema funcionamiento cron
«
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
« anterior
próximo »
Ir a:
Por favor selecciona un destino:
-----------------------------
Foro Linux
-----------------------------
=> Hardware
=> Instalacion
=> OpenOffice.org
=> Programacion
=> Proyectos
=> Redes
=> Seguridad
=> Software
=> Dise
-----------------------------
Configuraciones
-----------------------------
=> Trucos Hardware
=> Trucos
-----------------------------
Foro FreeBSD
-----------------------------
=> Free BSD
-----------------------------
Foro NetBSD
-----------------------------
=> Net BSD
-----------------------------
Foro general
-----------------------------
=> Discusiones
=> Sugerencias
Loading...