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


Thanks for the tips Brian. I have updated my script accordingly but (as
you
guessed) this has made no difference when run via cron. :(

-----Original Message-----
From: Brian Dessent [mailto:brian@dessent.net] 
Sent: 14 November 2006 11:12
To: cygwin@cygwin.com
Subject: 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



=================================================

Rubicon Fund Management LLP is Authorised and Regulated by the Financial Services Authority.
Telephone: 44(0) 20 7074 4200
Fax:       44(0) 20 7074 4299

Registered in England: Partnership No OC300480 Registered Office:  42-46 High Street, Esher, Surrey  KT10 9QY

Important Notice:
This message is for the named recipient(s) use only.  It may contain confidential, proprietary, or legally privileged information.  No confidentiality or privilege is waived or lost by any mistransmission.  If you have received this message by error, please immediately notify the sender, delete it and all copies of it from your system, destroy any hard copies, and notify postmaster@rubicon-uk.com.  If you are not the intended recipient, you must not use, disclose, distribute, print, or copy any part of this message directly or indirectly.


--
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]