delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/04/18/12:43:38

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Kevin Markle <kmarkle AT pbs DOT org>
Subject: Re: crontab not sending output to me?
Date: Mon, 16 Apr 2007 16:02:44 -0400
Lines: 66
Message-ID: <mn.83c27d74714eab68.51129@pbs.org>
References: <mn DOT 6bbb7d74a1f51521 DOT 51129 AT pbs DOT org> <03a301c77e16$ae86d240$3c0110ac AT wirelessworld DOT airvananet DOT com>
Reply-To: kmarkle AT pbs DOT org
Mime-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Pierre A. Humblet wrote on 4/13/2007 :
> ----- Original Message ----- 
> From: "Kevin Markle" <>
> To: <>
> Sent: Friday, April 13, 2007 3:55 PM
> Subject: crontab not sending output to me?
>
>
>> Hello,
>> 
>> I'm running this crontab. When I run /cygdrive/e/wsus/run_all_groups.sh
>> from a command line it works but when I run it from cron I get no 
>> content in the email I recive.
>> 
>> My Crontab:
>> MAILTO=""
>> # minute   hour   day of month   month   day of week   command
>> 0       8       *       *       2,4     
>> /cygdrive/e/wsus/run_all_groups.sh
>> 0       22      *       *       0,2     
>> /cygdrive/e/wsus/run_all_groups.sh
>> 0       16      *       *       *       
>> /cygdrive/e/wsus/run_all_groups.sh
>> 51      15      *       *       *       
>> /cygdrive/e/wsus/run_all_groups.sh
>> 
>
> Given that MAILTO="", you should not receive an e-mail. So that answers
> the Subject of your e-mail. However the body suggests that you receive
> some e-mail from cron, which is strange.
>
> Could you clarify what the problem is, tell us if cron is running (ps -a 
> shows it), provide any useful info from the Windows event log and 
> /var/log/cron.log as well as the output of 'cygcheck -srv > cygcheck.txt' as 
> an attachment.
>
>  If you remove MAILTO="", cron will attempt to send you the output through
> /usr/sbin/sendmail. What does that point to? If it points to 
> /usr/bin/cronlog, the output should appear in HOME/cron.log, or in case of 
> error there should be temporary files in /tmp. 
>
> Pierre (going away until Monday).

Hello,

I use a Windows email program to send email from the script I have 
written. When I run the script from a shell prompt it runs fine and 
sends email to be but when I run it from cron I get a email but text in 
the body.

I setup this as you had suggested earlier:
It's working because we know it's trying to mail you something.
To find out what, remove MAILTO="" and install a poor man's mailer as 
follows.
It will write the mail output to /cronmail.txt

Pierre

~: cd /
/: cat > cronmail.sh
cat > /cronmail.txt
/: chmod a+rx /cronmail.sh
/: cd /usr/sbin
/usr/sbin: ln -sf /cronmail.sh sendmail




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019