Command Line Utilities / Crons
Top  Previous  Next

Some Hyperseek functions may be run from the server's command line (either manually, or automatically via "cron"). These functions are largely identical to some of the functions in the web based admin center ... and a few are designed to run ONLY from the command line. A list of the available command line functions are shown below, along with an explanation of purpose and usage.

Re-Count Categories:  
admin.php -cron hyperseek category_count  
This is the same as running the "ReSynchonize" Function from the Hyprseek Category Manager. From the command line, this runs much quicker, and consumes less memory. Addionally, since this is a manual operation, you may elect to have your server run this nightly, in cron, to keep your category counts up to date constantly.  
 
Monthly Keyword Billing:  
admin.php -cron hyperseek monthlybilling {charge}  
If you are charging your advertisers "by the month" instead of "by the click", this command line utility must be run each night. This will calculate their current balance, and will renew (and charge) the customer if their listings run out based on the time of their last payment. It will email the customers a summary of it's financial findings.  
 
Monthly Keyword Billing:  
admin.php -cron hyperseek keyword_minimums  
If you are charging your advertisers "by the month" for keywords instead of "by the click", this command line utility must be run each night. This will calculate the new, higher minimum bids for "busy" keywords as defined in your PPC Preferences.  
 
Verify Active URLs:  
admin.php -cron hyperseek deadlinks {n}  
This will go through the database and detect dead links by attemting a browse to each listing in your database "n" links at a time. We recommend doing no more than 100 to 200 listings during any one session due to the networking overhead required to complete this task. Once this is complete, you will be able to review a list of any dead links by opening up the "Dead Links Report" from the Report menu in hyperseek.  
 
Pay affiliates (direct deposit into account):  
admin.php -cron hyperseek affpay  
If you wish to pay your affiliates via direct deposit into their bidding account, then use this utility each day (via cron, if possible) to calculate their earnings for the previous day. Any earnings will be added to their account's current balance. The affiliate can then request a withdrawl at any time to receive the actual funds owed.  
 
Audit Affiliates:  
admin.php -cron hyperseek audit  
This will generate a report for you indicating the sum of any over or under payments made to affilates. Any differences will be logged as a debit/credit in the transaction history for the affiliate.  
 
Autobill Accounts with Low Balances  
admin.php -cron hyperseek autobill  
If you are setup to use automatic billing to your merchant's secure server (Verisign or Authorize.net users only), this utility will auto-charge any accounts that are low on funds as specified by the user.  
 
Autobill Accounts for daily charges  
admin.php -cron hyperseek autobill - daily  
If you are setup to use automatic billing to your merchant's secure server (Verisign or Authorize.net users only), this utility will auto-charge any accounts that have requested autobilling of a certain amount on a certain day of the month ... as specified by the user.  
 
Re-Generate Master Merge Tables:  
admin.php -cron hyperseek mergetables  
If you are using merge tables, This will create your merge tables and re-define the parent tables. You should run this in cron at 12:01am on the first of every month.  
 
Re-Summarize all Clicks & Fraud:  
admin.php -cron hyperseek summarize_clicks {date}  
Note that date can be "all" or a date in "yyyymmdd" format. This function will re-generate all of the log summary tables for the reports from the information contained in the raw log database tables. It's designed to correct poor addition/subtraction in the reports and summary data over the course of time. Recommend to run once weekly via cron.  
 
Clean Up Jackhammer Fraud Log Tables:  
admin.php -cron hyperseek table_cleanup  
This must be run in cron nightly. It empties out one of the log tables, which prevents multiple clicks on links from the same IP number in the same day.  
 
Re-Generate Related Keywords List:  
admin.php -cron hyperseek generate_related_keywords  
Should also be run nightly in cron. This will create your "related tems" plugin, based on the bids, clicks, and searches done on every word in the database.  
 
Nuke Database  
admin.php -cron hyperseek nuke  
Be Careful ... this will delete every listing, category, and keyword bid.  
 
Import Category Tree:  
admin.php -cron hyperseek import_cats {file}  
This is the equivalent of using the Import Category from File utility in the Category Import area of the Hyperseek Admin Center.  
 
Import Listings  
admin.php -cron hyperseek import_links {file}  
If you have a perfectly formatted, pipe delimited text file of listings to import, this utility will pull them into the database for you. Note that after you've complete all but the last step of the web based listing import utility, there will be a file called "hyperseek.import" in your data/hyperseek directory. This file has been perfectly formatted by the web based import utility, and can be loaded either from the browser, or using this command line interface.  
 
Import links into the queue  
admin.php -cron hyperseek import_into_queue {file}  
This provides the same functionality as the "Import Listings" utility, but rather than insert the links to be loaded into the main links talbe, they are insserted into the Hyperseek Queue for review.  



Command Line usage of search.php (Non Source Users only)

The "search.php" application wears a few different hats. It is the main program used by your search engine for visitors to your web site, can serve XML or Inline results to your affiliates. Hyperseek, being a compiled application doesn't provide an easy means of running custom code, or writing add-on applications that take advantage of the Hyperseek core engine and systems.  
 
However, you can easily write an application based on all of the PHP functionality contained within search.php.  
 
1.Create a new .php file that does an "include_once" on search.php  
2.Write it like a regular program (all program globals, such as $language, $config, $iSQL, $CGI are exposed)  
3.Run it from the command line like this:  
4.php programname.php -exec  
 
When run with the "-exec" option, your search.php bypasses it's normal functionality, and instead, runs any custom code that you've written. As an example, here's a simple php application to demonstrate this theory. In this example, we use the $iSQL (mySQL Connection) variable and objects to run a simple search to the database that the program automatically connects to.....  
 
program: test.php  
 
<?php  
 
   include_once("./search.php");  
 
   global $iSQL;  
 
   $SQL = "SELECT count(*) FROM iweb_language";  
   $cnt = $iSQL->search( array("SQL"=>$SQL, "Return"=>"single") );  
 
   echo "There are $cnt records in iweb_language\n";  
 
?>