Article View: es.comp.os.linux.programacion
Article #9840Re: Bash (shell script) enviar mail
From: J.A. Gutierrez
Date: Fri, 10 May 2002 09:23
Date: Fri, 10 May 2002 09:23
31 lines
1881 bytes
1881 bytes
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:
<abg3it$nah$1@news.unizar.es>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!out.nntp.be!propagator2-SanJose!propagator-SanJose!in.nntp.be!news.telia-iberia.com!news.rediris.es!news.unizar.es!not-for-mailReferences:
<ab8stf$8sv$1@nsnmrro2-gest.nuria.telefonica-data.net>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-10 15:45:33 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!out.nntp.be!propagator2-SanJose!propagator-SanJose!in.nntp.be!news.telia-iberia.com!news.rediris.es!news.unizar.es!not-for-mail
From: "J.A. Gutierrez" <spd@daphne.cps.unizar.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Bash (shell script) enviar mail
Date: 10 May 2002 09:23:41 GMT
Organization: Rank
Lines: 31
Message-ID: <abg3it$nah$1@news.unizar.es>
References: <ab8stf$8sv$1@nsnmrro2-gest.nuria.telefonica-data.net>
NNTP-Posting-Host: daphne.cps.unizar.es
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.unizar.es 1021022621 23889 155.210.152.20 (10 May 2002 09:23:41 GMT)
X-Complaints-To: usenet@news.unizar.es
NNTP-Posting-Date: 10 May 2002 09:23:41 GMT
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (IRIX/6.2 (IP22))