Article View: es.comp.os.linux.programacion
Article #9758Re: Bash (shell script) enviar mail
From: Jorge
Date: Mon, 13 May 2002 14:33
Date: Mon, 13 May 2002 14:33
52 lines
2635 bytes
2635 bytes
Hola J.A.
La verdad es que puedo ver como funciona aunque no lo entiendo demasiado...
Te importar�a comentarme un poso el scrip?
Qu� ventajas tiene sobre el mio?
Porque el c�digo no se reduce, as� que algo mas har� (o de mejor manera)
> DF=`df /home | awk '/^\//{printf("%d\n", $5)}'`
> if [ "$DF" -gt 40 ]
De esta forma me mira el espacio que tiene en /home, pero no entiendo
df /home | awk '/^\//{printf("%d\n", $5)}'
(supongo que no solo me vendr� bien saberlo a mi ;)
Muchas gracias
Jorge
"J.A. Gutierrez" <spd@daphne.cps.unizar.es> escribi� en el mensaje
news:abg3it$nah$1@news.unizar.es...
> Jorge <jorge@mipaginapersonal.com> wrote:
> : Hola a todos y gracias de antemano.
>
> : Esoty haciendo un peque�o script en bash para que me env�e un mail
> : cuando una de las particiones se empieze a llenar.
>
> : Por ahora hago esto:
>
> : #!/bin/bash
>
> #!/bin/sh
>
> : # para enviar un mail
> : df | grep [4-9][0-9]% > kk
> : if test -s kk
> : then
> : echo "tiene `cat kk`"
> : fi
>
> DF=`df /home | awk '/^\//{printf("%d\n", $5)}'`
> if [ "$DF" -gt 40 ]
> then
> echo "${DF} ocupado en /home" | Mail -s disco foo@example.com
> fi
>
>
> --
> PGP and other useless info at \
> http://www.cps.unizar.es/~spd/ \
> finger://daphne.cps.unizar.es/spd \ Timeo Danaos et dona ferentes
> ftp://ivo.cps.unizar.es/pub/ \ (Virgilio)
Technical Details
Message-ID:
<aboiol$kiv$1@nsnmpen2-gest.nuria.telefonica-data.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!nsnmpen1-lo.nuria.telefonica-data.net!nsnmpen2-lo.nuria.telefonica-data.net!not-for-mailReferences:
<ab8stf$8sv$1@nsnmrro2-gest.nuria.telefonica-data.net> <abg3it$nah$1@news.unizar.es>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,c5fd9480149bd3c8 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2002-05-13 07:33:47 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!nsnmpen1-lo.nuria.telefonica-data.net!nsnmpen2-lo.nuria.telefonica-data.net!not-for-mail From: "Jorge" <jorge@mipaginapersonal.com> Newsgroups: es.comp.os.linux.programacion Subject: Re: Bash (shell script) enviar mail Date: Mon, 13 May 2002 16:33:02 +0200 Organization: Telefonica Data Espagna Lines: 54 Message-ID: <aboiol$kiv$1@nsnmpen2-gest.nuria.telefonica-data.net> References: <ab8stf$8sv$1@nsnmrro2-gest.nuria.telefonica-data.net> <abg3it$nah$1@news.unizar.es> NNTP-Posting-Host: 213-98-61-237.uc.nombres.ttd.es X-Trace: nsnmpen2-gest.nuria.telefonica-data.net 1021300309 21087 213.98.61.237 (13 May 2002 14:31:49 GMT) X-Complaints-To: usenet@nsnmpen2-gest.nuria.telefonica-data.net NNTP-Posting-Date: Mon, 13 May 2002 14:31:49 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000