[HPADM] SUMMARY: Anyone know the answer? find / -size works in shell but in cron size doesn't

From: Fong, Anna (anna@water.ca.gov)
Date: Fri Mar 28 2003 - 18:54:50 EST


Thanks to those who sent replies. I ended up getting my question answered at HP's ITRC.
Eef -- you were right that it sent mail regardless.

Here's the solution:
find / \( -name 'myLog.out' -a -size +0c \) | [ `wc -c` != 0 ] && mailx user@domain < /myLog.out

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x3c2eb941255cd71190080090279cd0f9,00.html

> -----Original Message-----
> From: Fong, Anna
> Sent: Friday, March 14, 2003 4:43 PM
> To: 'hpux-admin@dutchworks.nl'
> Subject: Anyone know the answer? find / -size works in shell but in cron size doesn't
>
> Anyone know the answer?
>
> In shell, I get file only if larger than zero. This is what I want.
> But when in cron, I get the file regardless of size even when it's
> zero.
>
> (find / \( -name 'myLog.out' \) -size +0 -exec cat {} \;) | mail user@domain
>
>
> Thanks for your help,
> Anna
> --------------------------------------------------------
>
> Anna Q. Fong, Webmaster
> California Data Exchange Center
>

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:28 EDT