[clug] Cron Problem

Chris Delfs delfs at rsc.anu.edu.au
Tue Oct 12 00:02:56 GMT 2004

Can someone tell me if there is something obviously wrong with the 

If I run this script from the command line
:~/tmp>cat mycat.sh
cd /home/delfs/tmp
/bin/cat file.txt | /bin/mail -s "My Test of cat" delfs at rsc.anu.edu.au

like so

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

More information about the linux mailing list