Option Directories -- repln Script

This page provides a reference guide for the repln script. The script is useful in creating and maintaining the symbolic links used to glue our opt directories together. The primary job repln does is to replicate symbolic links, but its options permit it to do more than that, and in some usefully-structured ways.

Command-Line Syntax

repln [ options ] [ from-directory ] ...

Where 'options' are selected from the following list. Options are divided into four categories:

Policy Options

--opt
Propagate standard /opt directory structure; ignores these other options: --(no)new, --(no)links, --to, --parent
--app
Create "convenience" links from an /opt/appname directory's standard subdirectories into /opt/bin, /opt/lib, etc.; ignores these other options: --(no)links, --parent; implies --new
-d, --dev
Do a "developer" replication, including the include subdirectory. Only applies when the --opt or --app options are used.
--master, --mstr
Initial install of an app in a "master" /opt directory remotely. This is actually just shorthand for --sub=s+/mstr++, but when used with --from=/opt/mstr/appname --to=/opt/mstr, works really cool

File-Related Options

-n, --new
Also create new links to real files found in "from" directories
--nonew
Do not create new links to real files (default)
-l, --links
Replicate symbolic links (default)
--nolinks
Do not replicate symbolic links
-m, --mkdirs
Make new target directories if they do not exist (especially useful when the --recursive option is used)
--recursive
Traverse any subdirectories found, and perform requested operation in them, too. Often more useful if the --mkdirs option is also given.
-s cmd, --sub=cmd
Perform a perl substitute command on link contents before creating the link (eg. --sub=s/pkg/mstr/, or -s s+/mstr++). Use this when the links are being created in the right place, but for some reason have the wrong value.

Operational Preferences

-q, --quiet
Quiet mode; don't show the rename commands as they are executed
--verbose
Verbose mode; show more info about operation
-v, --view
View-only mode; show links which would be created, but don't actually create them
--force
Replace existing links (otherwise they're skipped)
--refresh
Skip items which already have a target link
-h, --help
Print this help message

Location Options

-f dir, --from=dir
Set "from" directory, eg. -f /net/srvr01/_c/opt.10, or --from=/opt/appname
-t dir, --to=dir
Set "to" directory, into which links will be created (default current working directory)
-p dir, --parent=dir
Set "parent" directory; when this option is used, directory names listed positionally on the command line are subordinate to this parent directory

Usage Notes

Note that the --parent and --from options are mutually exclusive. To include the parent directory itself when using --parent, add "." (a period, meaning current directory) to the list of subdirectories. Also, --nonew and --nolinks are mutually exclusive; since --nonew is the default, this means that --nolinks must be accompanied by --new.

In the output, a ---> marker denotes a replicated symbolic link. A -+-> marker denotes a new link, created to point to a real file.

Examples

After a new app is created in /opt/mstr, to install convenience links on the master machine itself:

   repln  --app  --from=/opt/mstr/appname  --to=/opt/mstr  --master
After one or more new apps have been installed, to propagate links to another host:
   repln  --opt  --from=/opt/mstr  --to=/net/hostname/opt  --refresh
To just replicate a set of links from one directory to another:
   repln  --from=fromdir  --to=todir
It is always recommended that you try a command with the --view (or -v) option first, before you actually make the links. Remember that the --from= and --to= options can be abbreviated as -f and -t respectively. All the options are summarized above.


Last modified: Wed 26 Nov 1997