Solved

Godaddy Cron Job To Execute Perl Script

Posted on 2010-08-13
5
1,676 Views
Last Modified: 2013-11-30
I am trying to execute a perl script from within Godaddy's cron setup.
Here is the format:

#!/usr/bin/perl  "$HOME/html/cgi/search/indexer.pl"

Does this look correct?

this is what Godaddy says:
The Command field is the script or executable that runs at a specified frequency. Click Browse to locate a file in your hosting account. The full file name of your selection is placed into this editable field.

Cron commands are typically script files that have executable permission and specify their interpreter as the first line of the file. For example, a first line of "#!/usr/bin/perl" directs the system to run the perl language interpreter for the file.

Your Shared Hosting account supports the following languages and associated interpreter lines:
Perl: #!/usr/bin/perl
Python 2.2: #!/usr/bin/python2.2
Python 2.3: #!/usr/bin/python2.3
Python 2.4: #!/usr/bin/python2.4
Ruby: #!/usr/local/bin/ruby
Bash: #!/bin/bash
The installed versions of PHP 4 and PHP 5 do not support the interpreter specification in a PHP file. In order to run a PHP script via Cron, you must specify the interpreter manually. For example:
PHP 4: /web/cgi-bin/php "$HOME/html/test.php"
PHP 5: /web/cgi-bin/php5 "$HOME/html/test.php5"
Note: In this example script, "$HOME" represents the full path to your Shared Hosting account. The actual path to your account will be provided if you select the script from your account using the Browse button.
0
Comment
Question by:IcarusOne
  • 2
  • 2
5 Comments
 

Author Comment

by:IcarusOne
ID: 33430151
My point is that what I have doesnt seem to be working.
0
 
LVL 5

Expert Comment

by:group0
ID: 33431378
Is the file executable?  If not, you won't be able to run it directly via cron

chmod +x $HOME/html/cgi/search/indexer.pl

Also make sure that the shebang line is correct (i.e. you can run Perl with "/usr/bin/perl -v").  If not, run "which perl" to find out the correct location for the interpreter.
0
 
LVL 3

Expert Comment

by:ckhsu1977
ID: 33470483
Just specify this
$HOME/html/cgi/search/indexer.pl as the command for the cron job

Make sure the first line of your indexer.pl script is #!/usr/bin/perl

According to this
"Note: In this example script, "$HOME" represents the full path to your Shared Hosting
account. The actual path to your account will be provided if you select the script from your account using the Browse button"

Make sure specify actual path to your perl script instead of using $HOME



0
 

Author Comment

by:IcarusOne
ID: 33475289
ckhsu1977

This is what i placed:

#!/usr/bin/perl  "/home/content/e/e/m/secret/html/cgi/search/indexer.pl"

Is this correct?
0
 
LVL 3

Accepted Solution

by:
ckhsu1977 earned 500 total points
ID: 33476506
Just this
/home/content/e/e/m/secret/html/cgi/search/indexer.pl
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now