How to use FDSE from the command line
The script "searchmods/powerusr/cmd_admin.pl" provides a set of useful admin functions. It can be called from the command line. The syntax for the command is:
Usage: cmd_admin.pl Password=MyPassword listrealms cmd_admin.pl Password=MyPassword rebuild "My Realm 1" cmd_admin.pl Password=MyPassword rebuild "All" cmd_admin.pl Password=MyPassword listrules cmd_admin.pl Password=MyPassword setrule "crawler: rogue" 1 cmd_admin.pl Password=MyPassword add_url "My Realm 1" http://xav.com/ cmd_admin.pl Password=MyPassword add_site "My Realm 1" http://xav.com/ cmd_admin.pl Password=MyPassword create_realm "name=My Ream 2" file=file.txt type=1 base_url=x base_dir=y
The full details on the syntax can be seen by running cmd_admin.pl with no arguments, or by viewing the Perl source of the file.
FDSE's search.pl accepts command-line parameters as well. Each name=value pair that would normally be submitted by the browser can be submitted on the command line as a single argument. For example, to rebuild a local file index for the Realm "Foo", use the following command:
perl search.pl Mode=Admin Password=abc Action=rebuild \ Realm=Foo UseTimeout=0
The method of calling search.pl directly is discouraged because many functions -- like rebuilding index files -- are restartable and will try to restart themselves using HTML META refresh commands. The META refresh only works with web browsers and does not work from the command line. The "cmd_admin.pl" script has special logic for restarting.
FDSE commands must be run from the folder which contains the script being called. If you create shell scripts or batch files for command admin tasks, be sure to change directory to the folder with the script before calling it.
Note: if you have renamed the main script to something other than "search.pl" or "search.cgi", you will need to edit "cmd_admin.pl" and enter the new filename. The command-line utility functions by calling the main script. Also, do not allow both "search.pl" and "search.cgi" to exist from different versions. The utility may call the wrong one and fail.
History: the cmd_admin.pl file was introduced with FDSE version 2.0.0.0041 and newer. The add_url, add_site, and create_realm commands were added with FDSE build 0054.
"How to use FDSE from the command line" https://www.xav.com/scripts/search/help/1064.html