[wellylug] Bash script not working all the time

Peter Lynch Peter.Lynch at FINEOS.com
Fri Sep 16 13:45:35 NZST 2011


Hi everyone,

I have the following bash script which works, i.e. touches the specified
file, when I run it from the command line, but not when it is run from
cron.  Does anyone know why?

#!/bin/bash

# This script checks to see if there are any files
# in the Postfix deferred mail queue

cd `postconf -h queue_directory`
cd deferred
if [ `find . -type f | wc -l` -eq 0 ]
then
    touch /root/postfix_deferred_queue
fi

Thanks

Peter Lynch
Technical Consultant
 
FINEOS New Zealand Ltd
c/o ACC, Level 2, Laptop House
23 Waring Taylor Street,
Wellington, New Zealand
DDI +64 4 918 7630 
W www.FINEOS.com <BLOCKED::http://www.fineos.com/> 
 
ENTERPRISE SOLUTIONS for INSURANCE, BANCASSURANCE AND SOCIAL INSURANCE


__________________________________________________________
FINEOS Corporation is the global brand name of FINEOS Corporation Limited and its affiliated group companies worldwide.
The information contained in this e-mail is confidential, may be privileged and is intended 
only for the use of the recipient named above. If you are not the intended recipient or a 
representative of the intended recipient, you have received this e-mail in error and must 
not copy, use or disclose the contents of this e-mail to anybody else.  

If you have received this e-mail in error, please notify the sender immediately by return 
e-mail and permanently delete the copy you received.  This e-mail has been swept for 
computer viruses. However, you should carry out your own virus checks. 
Registered in Ireland, No. 205721.  http://www.FINEOS.com
__________________________________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20110916/87fb1677/attachment.htm>


More information about the wellylug mailing list