This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cron and find


will.wright@tiscali.co.uk wrote:

> 4 10 * * 1-5 find /cygdrive/d/Apps_v8p4//Bridge/DataFeed/deploy//quotefeed/logs
> -type f -name stdout.log\.* -mtime +2 > /cygdrive/d/Apps_v8p4/Bridge/DataFeed/deploy/bin/testfind.log

The need for quoting the argument to -name is to keep the shell from
expanding globs (* and ?), so that they can be evalulated instead by
find.  This can be done either with quotes or backslashes, so I would
expect to see

-name stdout.log.\*

or

-name stdout.log\*

where the former would match only stdout.log.03Nov2006 and the latter
would match both that and stdout.log.  However, what you have:

-name stdout.log\.*

does not make any sense as the "." is not a glob character and does not
need to be quoted, leaving the "*" unprotected and vulnerable to shell
expansion if there happened to be a matching filename in the current
directory (although that typically results in syntax errors from find.) 
This could explain why it happens to work from the command line but not
in cron, but it's kind of a long shot.  I don't see any other common
cron problems (D is not a network drive and your mounts are
system-mode.)  In any case I would fix the quoting, regardless of other
issues.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]