Need help with crontab

Chris F.A. Johnson c.f.a.johnson-bJEeYj9oJeDQT0dZR+AlfA at public.gmane.org
Sat Sep 20 23:31:34 UTC 2003


On Sat, 20 Sep 2003 waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org wrote:

>   Yes, I did RTFM.  The latest Windows virus making the rounds is
> affecting even this linux user.  I have a 10 megabyte inbox at clss.net
> which I use because it allows me full control over blocking.  That box
> has already overflowed twice in the past couple of days, thanks to Gibe.F
> (or whatever it's called).  I normally use mutt to pull email manually
> into my home directory via a script ~/bin/clssmailin which consists of
> the lines...
>
> #!/bin/bash
> ssh -P -f -L 10110:pop3.clss.net:110 my_user_ID-1sV0mdQTbhc at public.gmane.org sleep 25
> /usr/bin/mutt -F /home/waltdnes/.symmutt/clssmuttrc
>
> by putting "push Gqy" into the config file, mutt receives the keystrokes
> G - (Get popmail) followed by
> q - quit
> y - "yes" to the confirmation prompt
> setting 10110 as the pop port, and 127.0.0.1 as the pop server are the
> only changes required for ssh-tunneling
>
>   Given the approximate 2/3rd of a megabyte per hour I get from my
> mailing lists+Gibe.F, I'd like to automate this, so the computer can
> pull it without me having to issue the command manually.  I've tried
> crontab as follows...
>
> # use /bin/sh to run commands, no matter what /etc/passwd says
> SHELL=/bin/sh
> # no mail sent
> MAILTO=""
> #
> # run every hour
> 43 * * * * /misc/home/waltdnes/bin/clssmailin >> /misc/home/waltdnes/out 2>&1
>
>   (*YES* it is /misc/home/waltdnes) Nothing happens, and the out file
> gets the message...
>
> sh: line 1: gettext: command not found
> No recipients were specified.
>
>   When I run clssmailin manually, it works, although I do get the
> "sh: line 1: gettext: command not found" message.  I've tried it with
> and without "#!/bin/sh" as the first line.  Any clues on getting this to
> work?

     Cron jobs do not have the environment your interactive shell has.
     The usual culprit is the PATH variable. Make sure you set it
     explicitly, either in the crontab file or in the script itself.

     You mighjt also look at using mailfilter:
              <http://sourceforge.net/projects/mailfilter/>

     It will not catch them all, but it can prevent downloading the
     majority of unwanted junk.

-- 
	Chris F.A. Johnson
	=================================================================
	cfaj-uVmiyxGBW52XDw4h08c5KA at public.gmane.org                      http://cfaj.freeshell.org
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list