[GLLUG] find / shell weirdness

Sharon Kimble boudiccas at talktalk.net
Tue Oct 8 09:51:22 UTC 2013


On Tue, 8 Oct 2013 10:30:02 +0100
tid <td at bloogaloo.co.uk> wrote:

> Folks,
> 
> I have a small bash script which watches a number of folders for files
> added in the last 10 minutes:
> 
> ($mydirs below is just a list of ftp folders which clients upload to )
> 
> ===================================================
> find $mydirs -type f -a -cmin -10 -print > /tmp/filewatcher.count
> 
> if [ `wc -l /tmp/filewatcher.count | awk ' { print $1 } ' ` -gt 0 ]
> then
>         # email me notification bla bla bla
>         [ snip ]
> fi
> ====================================================
> 
> So, this has been working fine but recently it's started giving me a
> lot of false positives - i.e the 'if' statement is firing, but no
> files are found - is there
> some shell expansion going of which I'm unaware, or is it the more
> likely PBKAC?
> 
> Tid

Whats the value of 'filewatcher.count'?

Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
efever = http://www.efever.blogspot.com/
efever = http://sharon04.livejournal.com/
my git repo = https://github.com/boudiccas/dots
Debian stable, Fluxbox 1.3.5, LibreOffice  4.1.0.4
Registered Linux user 561944
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20131008/ba1936d8/attachment.pgp>


More information about the GLLUG mailing list