www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/07/28/12:15:59

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 28 Jul 2008 18:15:13 +0200
From: r <r-trev AT fastwebmail DOT it>
To: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder AT niaid DOT nih DOT gov>
Cc: cygwin AT cygwin DOT com, r-trev AT fastwebmail DOT it
Subject: Re: script
Message-ID: <20080728161513.GA1532@linux.local>
Reply-To: r-trev AT fastwebmail DOT it
References: <20080726221147 DOT GA1752 AT linux DOT local> <g6gful$87d$1 AT ger DOT gmane DOT org> <20080727151058 DOT GA3548 AT linux DOT local> <31DDB7BE4BF41D4888D41709C476B6570929B222 AT NIHCESMLBX5 DOT nih DOT gov>
Mime-Version: 1.0
In-Reply-To: <31DDB7BE4BF41D4888D41709C476B6570929B222@NIHCESMLBX5.nih.gov>
User-Agent: Mutt/1.4.2.2i
X-Operating-System: CYGWIN_NT-5.1 1.5.25(0.156/4/2)
X-Disclaimer: Linux
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Monday 28 July 2008, alle 10:34, Buchbinder, Barry (NIH/NIAID) [E] wrote:
> r wrote on Sunday, July 27, 2008 11:11 AM:
> >  Saturday 26 July 2008, alle 19:36, René Berber wrote:
> >> r wrote:
> >> 
> >>> How can I execute a script at boot time ?
> >>> it's a simple retrieving email script with 'getmail' [snip]
> >> 
> >> An easy way is to use cron, with 'crontab -e' add a line like this:
> >> 
> >> @reboot /bin/startup_retrieve_mail.sh > /dev/null 2>&1
> >> 
> >> Make sure the script is executable, the redirection is optional and
> >> perhaps shouldn't be used at the beginning in case there are error
> >> or unexpected messages, once its working you can put that in.
> 
> Another way is to put a shortcut in Windows' Startup folder with the
> following command line.
> 
> c:\cygwin\bin\sh -c /bin/startup_retrieve_mail.sh
> 
> This might be preferred by those who do not have any other reason to
> run cron.

ok, I'm going to learn to manage basic cygwin-linux features 
so I wrote two other scripts for cron ( backup, periodically download emails )

If I can I would ask you another question.
I saw unlike linux that cygwin does not warn me when there are new
messages. I configured cron to check every ten minutes
for incoming emails.
Is there a way ( like in linux ) to send a message to my prompt
( I don't use X ) that alert me when new emails have been arrived ?
I tried putting in the /usr/local/bin/startup_retrieve_mail.sh the
following lines

if grep -q e /var/spool/mail/Proprietario    
 then echo "You have new mail" 
fi                                           

but so cron sends me a new email with "You have new mail".
I tried to redirect it with 

echo "You have new mail" > /dev/console

but nothing happened. Do you know if what I am trying to do
is possible ??
( I'm very lack in programming )


R



--
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