Re: Automatic Emails...

From: ynotssor (ynotssor_at_example.net)
Date: 09/20/05


Date: Tue, 20 Sep 2005 14:19:06 -0700


<josh.miller@centralillinoiswb.com> wrote in message
news:1127250322.543051.235060@g14g2000cwa.googlegroups.com

> So what I'd like is to have the computer send a blank email daily so I
> can monitor the IP address.

In a crontab or startup script, use:

wget -O- http://cfaj.freeshell.org/ipaddr.cgi 2>/dev/null | \
    mail -s "Current IP address" you@some.where

to get it in the body, or in the Subject: header, just use a variable:

ipaddress=$(wget -O- http://cfaj.freeshell.org/ipaddr.cgi 2>/dev/null)
mail -s $ipaddress you@some.where < /dev/null >/dev/null



Relevant Pages

  • Re: strange email behavior
    ... On Monday 08 September 2003 18:36, Marc Adler wrote: ... A couple of weeks ago you set up fetchmail to work by entering some ... crontab commands. ... to use the /etc/init.d/fetchmail startup script. ...
    (RedHat)
  • SMS instead of mailing
    ... I am having the script scheduled in the crontab to monitor the ... performance of my system which will automatically mail me in critical ... Gopi Krishnan ...
    (comp.unix.shell)
  • RE: How to monitor a scritp
    ... > I made a script that works fine. ... > When a try to run it in crontab it seems it doesn't work. ... > you suggest me to monitor what it is happening? ... > need any explicit environment variables to run in crontab? ...
    (perl.beginners)
  • Re: best way to start fetchmail at boot
    ... > defined place for a startup script for each user. ... > need for a private demon to run all the time can have it. ... so the user's crontab may contain a line like this: ... to suck mail every 7.5 minutes ...
    (comp.unix.bsd.freebsd.misc)