pica(1)
NAME
pica - Copy files and execute commands remotely
SYNOPSIS
pica (-i|-t|-f|-x) [-n][-d][-v] +F files +H hosts
DESCRIPTION
PICA 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.
ACTIONS
- -i Installs (copies) the specified object(s) in the specified
- host(s).
- -t Deletes the specified object(s) from the specified host(s).
- -f 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.
- -x Executes remotely the specified command(s) in the specified
- host(s).
OPTIONS
- -d Debug mode: simply prints what it's supposed to do, without actu
- ally doing it, and prints lots of debug information.
- -n Do nothing. Prints commands to execute instead of actually exe
- cute them, a la make.
- -v Verbose mode. Prints some more text, but not debug- ging informa
- tion 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.
- #perl/#lrep
- 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.
EXAMPLES
- To 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
FILES
/etc/pica/pica.conf
/etc/pica/hosts.conf
/etc/pica/objects.conf
ENVIRONMENT VARIABLES
- PICAARGS
- contains arguments to automatically append to every pica call.
AUTHORS
Miguel Angel Armas del Rio <kuko@maarmas.com>
Esteban Manchado Velazquez <zoso@demiurgo.org>
SEE ALSO
- ssh(1) perl (1)