Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 16th, 2006, 07:07 PM
toastysquirrel toastysquirrel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 79 toastysquirrel User rank is Corporal (100 - 500 Reputation Level)toastysquirrel User rank is Corporal (100 - 500 Reputation Level)toastysquirrel User rank is Corporal (100 - 500 Reputation Level)toastysquirrel User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 15 h 45 m 51 sec
Reputation Power: 7
Problem with setting cron job script

My site's host has a unique method for running cron jobs, namely that they need to be "web based." The script that I'm running (rebuilding an index for my sites search) isn't a web based script. My host recommends wrapping the script and here's the example code they provide:
Code:
#! /bin/sh
echo "Content-type: text/plain";
echo;
cd "${SITE_ROOT}/var/www/html";
"${SITE_ROOT}/var/www/html/bin/example.pl";
echo "Script completed with exit code $?.";
exit 0;

The script has it's own arguments which look like this:
Code:
#!/bin/sh
cd /webroot/www.xav.com/search/searchmods/powerusr
perl cmd_admin.pl Password=password rebuild All

I've tried mixing them together with several different combinations however I keep getting any one of three outputs:
Code:
- "Script completed with exit code 2."
- "Script completed with exit code 127."
- "Warning: You have ENV SERVER_SOFTWARE defined. Unset it.
Content-Type: text/html
This script can only be called from the command-line.
Script completed with exit code 0."

At this point I'm at a loss as to what to try next; I keep getting those three outputs in addition the search index is *not* being rebuilt. Here is one of my attempts to get the code to work:
Code:
#! /bin/sh
echo "Content-type: text/plain";
echo;
cd "/var/www/cgi-bin/search/searchmods/powerusr";
perl "cmd_admin.pl Password=admin rebuild All";

echo "Script completed with exit code $?.";
exit 0;

I've tried numerous other combinations such as leaving out the quotes around the paths, inserting the ${SITE_ROOT}, listing the full absolute path for both the 'cd' and for the 'perl' command, and probably numerous others I don't recall off the top of my head. I'm wondering if there's anything that stands out as an obvious solution or if anyone can point me in a direction to figure it out.

Thanks a ton

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > Problem with setting cron job script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT