Cron Problem
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%26wFOCUS=EXYCTGSK=spkrfullsubmit=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 rgh...@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 BW 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? Thanks, Richard -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Cron Problem
On Sat, 22 Aug 2009 09:17:36 -0400 rgheck wrote: Whichever it is, does anyone know how this can be made to run? It is always fantastically difficult to know how many different layers of shell escape processing stuff is gonna wind up going through. If I were you, I'd make a shell script with that whole command in it, verify that the shell script works, then just invoke the shell script from cron so there won't be any shell escaping going on till it gets into the script itself. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Cron Problem
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%26wFOCUS=EXYCTGSK=spkrfullsubmit=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 rgh...@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 BW 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. pgpmD0r0I1OFt.pgp Description: PGP signature -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Cron Problem
On 08/22/2009 09:28 AM, Sam Varshavchik wrote: 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. Thanks. I'm guessing this solves it. rh -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Cron Problem
On Sat, 2009-08-22 at 09:17 -0400, rgheck wrote: 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 You know you don't have to put in every hour you want to run it if you want it done very so many hours such as below? 55 */2 * * * audiogon.pl -f /tmp/rss/bw.xml Above line would run your cron every 2 hours at 55 minutes after. -- Mike Chambers Madisonville, KY Fedora Project - Bugzapper, Tester, User, etc.. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines