Re: cron + Xdialog
Le dimanche 20 mar 2005 à 17 h 30, Michelle a dit:
> Hallo/Hello/Salut Steve,
Salut Michelle !
>
> ça marche maintenant...
>
>
> __( '/etc/cron.d/sscript'
> )___________________________________________
> /
> | SHELL=/bin/bash
> | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
> | MAILTO=linux4michelle@freenet.de
> |
> | * * * * * michelle.konzack
> /home/michelle.konzack/tmp/script/sscript >|
> >/home/michelle.konzack/tmp/script/sscript.log 2>&1
> >\_________________________________________________________________
> >_____
>
>
> ou
>
>
> __( command 'crontab -crone'
> )________________________________________
> /
> | SHELL=/bin/bash
> | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
> | MAILTO=linux4michelle@freenet.de
> |
> | * * * * * /home/michelle.konzack/tmp/script/sscript
> >>/home/michelle.k
> | onzack/tmp/script/sscript.log 2>&1
> \_________________________________________________________________
> _____
>
>
> __( '/home/michelle.konzack/tmp/script/sscript'
> )_____________________
> /
> | #!/bin/bash
> |
> | for HOTE in `cat /home/michelle.konzack/tmp/script/meshotes` ; do
> | fping $HOTE |grep "alive" >/dev/null 2>&1
> | DATE=`date "+%Y-%m-%d %H:%M:%S"`
> | if [ $? == "0" ] ; then
> | echo "$DATE : $HOTE is up."
> | export DISPLAY=":0.0"
> | Xdialog --title "Information" \
> | --msgbox "$DATE\n\nLa machine \"$HOTE\" est active." 0
> 0| fi
> | done
> \_________________________________________________________________
> _____
>
>
> __( '/home/michelle.konzack/tmp/script/meshotes'
> )____________________
> /
> | samba3.private.tamay-dogan.net
> | 192.168.1.65
> \_________________________________________________________________
> _____
>
>
> Resultat:
>
>
> __( '/home/michelle.konzack/tmp/script/sscript.log'
> )_________________
> /
> | 2005-03-20 17:23:01 : samba3.private.tamay-dogan.net is up.
> | 2005-03-20 17:23:09 : 192.168.1.65 is up.
> | 2005-03-20 17:24:01 : samba3.private.tamay-dogan.net is up.
> | 2005-03-20 17:24:07 : 192.168.1.65 is up.
> \_________________________________________________________________
> _____
>
Vielen Dank!
Du bist wunderbar Michelle ;-)
Question subsidiaire (work for tonight): et si le ping est bloqué,
mais que l'hôte est up, comment faire __facilement__?
>
> Michelle
Grüsse
steve
Reply to: