[clug] Cron Problem

Kim Holburn kim.holburn at anu.edu.au
Tue Oct 12 00:28:31 GMT 2004


Make the first line #!/bin/sh -vx

On 2004 Oct 12, , at 10:02 AM, Chris Delfs wrote:

> Can someone tell me if there is something obviously wrong with the 
> following.
>
> If I run this script from the command line
> :~/tmp>cat mycat.sh
> #!/bin/sh
> cd /home/delfs/tmp
> /bin/cat file.txt | /bin/mail -s "My Test of cat" delfs at rsc.anu.edu.au
>
> like so
> ~/tmp>./mycat.sh
>
> I get an email containing the text in "file.txt" (file.txt is an ascii 
> text file)
> So far so good
>
> I make a crontab entry
> ~/tmp>crontab -l
> MAILTO=delfs at rsc.anu.edu.au
> SHELL=/bin/bash
> HOME=/home/delfs
> */3 * * * * /home/delfs/tmp/mycat.sh
>
> and I get an email (every three minutes) from root/crond containing
>
> /home/delfs/tmp/mycat.sh: line 3: 13409 Broken pipe             
> /bin/cat file.txt
>     13410 Segmentation fault      | /bin/mail -s "My Test of cat" 
> delfs at rsc.anu.edu.au
>
>
> Do I need extra escapes/quotes in crontabs
>
> -- 
> Chris Delfs                                      email delfs at 
> rsc.anu.edu.au Research School of Chemistry                     Tel   
> +61 2 6125 3496
> Australian National University                   Fax   +61 2 6125 0750
> Canberra  ACT 0200 Australia
>
> -- 
> linux mailing list
> linux at lists.samba.org
> http://lists.samba.org/mailman/listinfo/linux
>
>
-- 
Kim Holburn
IT Manager, Canberra Research Laboratory
National Information and Communication Technology Australia
Ph: +61 2 61258620 M: +61 417820641
Email: kim.holburn at anu.edu.au  - PGP Public Key on request
Cacert Root Cert: http://www.cacert.org/index.php?id=16 -> 
http://www.cacert.org/cacert.crt
Aust. Spam Act: To stop receiving mail from me: reply and let me know.

Democracy imposed from without is the severest form of tyranny.
                           -- Lloyd Biggle, Jr. Analog, Apr 1961



More information about the linux mailing list