Cron Problem

Sam Varshavchik mrsam at courier-mta.com
Sat Aug 22 13:28:34 UTC 2009


rgheck writes:

> 
> Hi,
> 
> Here is a line from my cron file:
> 
> 55 2,4,6,8,10,12,14,16,18,20,22 * * * audiogon.pl -f /tmp/rss/bw.xml 
> 'http://cgi.audiogon.com/cgi-bin/srch_fs.pl?WORD=b%26w&FOCUS=EXY&CTGSK=spkrfull&submit=Search'
> 
> It doesn't matter here what the audiogon.pl script does. (It scrapes the 
> URL given and creates an RSS feed.) The problem is that this will not run.
> 
>> /bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
>> /bin/sh: -c: line 1: syntax error: unexpected end of file
>>
>>    
> The subject line of the email reads:
> 
> Cron <rgheck at rghquad> /home/rgheck/bin/audiogon.pl -f /tmp/rss/bw.xml 
> 'http://cgi.audiogon.com/cgi-bin/srch_fs.pl?WORD=b
> 
> So the problem seems to be the embedded "%26" in the command: Thats is 
> the URL-encoding for the ampersand (we're searching for "B&W" 
> loudspeakers).  But even the single-quotes seem not to be protecting it 
> from the shell. And is it relevant that it encodes the ampersand? Or is 
> it the "%" that is causing the problem?
> 
> Whichever it is, does anyone know how this can be made to run?

>From the crontab(5) manual page reads:

       The "sixth" field (the rest of the line) specifies the  command  to  be
       run.   The  entire  command  portion  of the line, up to a newline or %
       character, will be executed by /bin/sh or by the shell specified in the
       SHELL  variable  of  the  cronfile.   Percent-signs (%) in the command,
       unless escaped with backslash (\), will be changed into newline charac-
       ters,  and  all  data  after the first % will be sent to the command as
       standard input.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20090822/f05ddd33/attachment-0001.bin 


More information about the users mailing list