[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cron + Xdialog



Hallo/Hello/Salut Steve,

ç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.
 \______________________________________________________________________


Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/ 
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/3/88452356    67100 Strasbourg/France   IRC #Debian (irc.icq.com)

Attachment: signature.pgp
Description: Digital signature


Reply to: