Find the answer to your Linux question:
Results 1 to 5 of 5
I've got a super-simple script that uses mail to send me update-log files, but the only problem I've got with it is that I need to manually hit CTRL+D to ...
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Location
    Salt Lake City, UT, USA
    Posts
    32

    cron job that mails log files?

    I've got a super-simple script that uses mail to send me update-log files, but the only problem I've got with it is that I need to manually hit CTRL+D to send the message.

    A co-worker recommended using sendmail, but I don't see anything in the manual about attachments. Then I wonder if I could use uuencode piped to sendmail to send these messages ..... and the more complicated it gets.

    Does anyone know how I can use mail to automatically send a message without manually hitting CTRL+D?

    mail -s 'Logs and stuff' -a patchesdesc.notinst -a patchesdesc.inst -a patches.notinst bknorr@dooodaadeelalalala.com

  2. #2
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Location
    Laurasia
    Posts
    624
    Will sound silly but it works

    Code:
    echo | mail -s <blah blah>
    Yes you are echoing nothing there, its just a space.
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

  3. #3
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    Try this:

    Code:
    mail -s 'Logs and stuff' -a patchesdesc.notinst -a patchesdesc.inst -a patches.notinst bknorr@dooodaadeelalalala.com << ++EOT++
    ++EOT++

  4. #4
    Linux User Agent-X's Avatar
    Join Date
    May 2005
    Location
    Dimension X
    Posts
    261
    Are you guys serious? This command allows a user to send a piece of my from his/her current IP address without having to use a server or some other silly system?

    I've been looking for something like that for ages. I didn't know it was as simple as that.

  5. #5
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Location
    Laurasia
    Posts
    624
    There is nothing special going on here. Emails are sent in this way only. The trick is to get a sendmail (like) server running on something that has a global IP address. Every mailing service does this.

    Ask yourself this "Do you need some special stuff to send postcards?" No, all you need is a post-box or an agent! Same here.
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...