Results 1 to 5 of 5
I have a script on my site that creates a sitemap, and I want to run it weekly. In order to prevent unauthorized use of the script, it requires a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-12-2012 #1Just Joined!
- Join Date
- Dec 2012
- Posts
- 2
cron command with an argument
I have a script on my site that creates a sitemap, and I want to run it weekly. In order to prevent unauthorized use of the script, it requires a "token" when the file is called. When the cron command line reads:
/web/cgi-bin/php5 "/home/html/cgi-bin/sitemapxml.php"
I get "Incorrect Start Security Token" error, just like I am supposed to. But when the cron command line reads:
/web/cgi-bin/php5 "/home/html/cgi-bin/sitemapxml.php token=xxxxxx"
I get "Status: 404 Not Found Content-type: text/html No input file specified."
How do you properly add arguments to a cron command line? I actually have more than one that needs to be added.Last edited by MRusty; 12-12-2012 at 11:49 PM. Reason: typo
- 12-13-2012 #2Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 398
Since you put the following in quotes, it is treated as a single argument (and I believe you want two args):
If you were running it from the command line would you be executing:Code:/home/html/cgi-bin/sitemapxml.php token=xxxxxx
Then remove the quotes and use:Code:/web/cgi-bin/php5 /home/html/cgi-bin/sitemapxml.php token=xxxxxx
Also realize that the environment is usually contains less when running in cron.Code:/web/cgi-bin/php5 /home/html/cgi-bin/sitemapxml.php token=xxxxxx
- 12-13-2012 #3Just Joined!
- Join Date
- Dec 2012
- Posts
- 2
Thank you so much alf55!
All I needed to do was remove the quotes. I have allowed my ISP's cron manager wizzrd "Browse" button to create the command line, and it screwed it up.

But I am not exactly sure what you meant by: "Also realize that the environment is usually contains less when running in cron. "
- 12-13-2012 #4
He meant, that an interactive shell potentially has a different env than cron. Think $PATH, etc
So a script that runs fine manually can behave differently via cron.Last edited by Irithori; 12-14-2012 at 08:38 AM. Reason: typo
You must always face the curtain with a bow.
- 12-14-2012 #5Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 398
Thanks for the reply Irithori, I could not have said it better.


Reply With Quote

