SYNOPSISpica (-i|-t|-f|-x) [-n][-d][-v] +F files +H hosts
DESCRIPTIONPICA is a program for system administration. It copies files, after preprocess them, to remote hosts, and execute commands remotely.
It has three configuration files: pica.conf, hosts.conf and objects.conf, where information about external programs, the hosts to manage and the objects defined is given.
For full documentation and examples, please refer to the PICA manual, available in LaTeX and Postscript.
- Installs (copies) the specified object(s) in the specified host(s).
- Deletes the specified object(s) from the specified host(s).
- Calculates and prints the differences between the currently installed version of the object(s) in the specified hosts(s) and the version that should be installed.
- Executes remotely the specified command(s) in the specified host(s).
- Debug mode: simply prints what it's supposed to do, without actually doing it, and prints lots of debug information.
- Do nothing. Prints commands to execute instead of actually execute them, a la make.
- Verbose mode. Prints some more text, but not debug- ging information like -d.
PPP (PERL PREPROCESSOR)Every config file and distribution file is preprocessed by PICA before parsing or distributing it. The Perl Preprocessor allows the user to dynamically build the file by means of conditionals and random Perl code. The basic syntax is that of the C preprocessor, but adapted to Perl.
In general, every expression is an arbitrary Perl expression, and besides internal variables and functions, distribution files always have $picahost and $picaobject variables available. The special directives understood by PPP are:
- #include "expression"
- Includes a file, after preprocess it. Searchs for the file in the current file's directory.
- #include <expression>
- Includes a file, after preprocess it. Searchs for the file in the include directories (picainclude).
- #if (expression)/#elsif (expression)/#else/#fi
- Treats that portion of the file conditionally.
- Executes the Perl code enclosed and prints in the output file the returned value. Everything printed in this environment will be printed at preprocessing time to the screen.
- Similar to the #perl/#lrep environment, only this is a one-liner version.
EXAMPLESTo install the object "named" in the hostgroup "dnsservers":
pica -i +F named +H dnsservers
To install the objects "motd" and "proftpd" in the hosts in the group "ftpservers" except to the host "nt" just type:
pica -i +F motd proftpd +H ftpservers -H nt
To execute the command "killall -9 netscape" in the single host "solaris-1":
pica -x +F "killall -9 netscape" +H solaris-1
- contains arguments to automatically append to every pica call.