Appendix I. SYSADMIN Commands

This appendix describes the various Sys Admin commands you can use via the Command Line Interface (CLI). These descriptions include an explanation of what that command will do and a summary of the command-line options for each command. The descriptions cover the following:

netutar

You can also initiate backups and restores via the Command Line Interface (CLI). The program to invoke a backup or restore is called netutar and is located in the $ENLIGHTEN/bin directory. You can use the CLI version of Archive to run unattended nightly backups of all the systems when the system/network load is at the lowest use.

netutar is fully compatible with tar, but netutar has the added feature of verification. By specifying the -v option, netutar will compare the size of the image on tape with that of the original on disk. If the size matches, netutar will compare the backup with the original image byte for byte.

The actual invocation for netutar is

# ./netutar X

where X can be any combination of the following options:

c 

- Create tape archive

f 

- Input/output device name

File. This causes netutar to use the device argument as the name of the tarfile. If the name of the tarfile is `-', netutar writes to the standard output or reads from the standard input, whichever is appropriate. Thus, netutar can be used as the head or tail of a pipeline.

t 

- Get table of contents

Table of Contents. The names of the specified files are listed each time they occur on the tarfile. If no filename arguments are given, all the names on the tarfile are listed. With the -v function modifier, additional information for the specified files is displayed. The listing is similar to the format produced by the ls -l command.

v 

- Verbose output contents

Verbose. Normally, netutar does its work silently. This option causes netutar to output the name of each file it treats, preceded by the function letter.

x 

- Extract files from archive

Extract or restore. The named filenames are extracted from the tarfile and written to the current directory. If a named file matches a directory whose contents had been written onto the tarfile, this directory is (recursively) extracted. Use the file or directory's relative path when appropriate or netutar will not find a match.

The owner, modification time, and mode are restored (if possible); otherwise, to restore an owner, you must be the superuser. If no filename argument is given, the entire content of the tarfile is extracted.

If several files with the same name are on the tarfile, the last one overwrites all earlier ones.

b 

- Device block size

Blocking Factor. This causes tar to use the block argument as the blocking factor for tape records. The default size is 20, the maximum is 2000.

The maximum blocking factor is determined only by the amount of memory available to tar when it is run. Larger blocking factors result in better throughput, longer blocks on nine-track tapes, and better media utilization.

k 

- Device size in Kb

K 

- Like `k' but files are never split across volumes

F 

- Filename containing list of input files. (`-' stdin)

I 

- Incremental backup based on date of last modification

L 

- Name of logfile to be created

P 

- Only files from named partitions are to be archived

S 

- Skip files named “*.o”, “a.out”, and “core”

SS 

- Skip all the `S' type files and skip any SCCS directories

T 

- Name of table of contents file

X 

- Output this explanation

p_nsnaps

This creates new disk snapshots from remote hosts. This command is
found in:

$ENLIGHTEN/bin/p_nsnaps

The usage is

./p_nsnaps [-i] [-n] [-v] [-x] [-p partitions] [host | pool ...]

where the options mean:

-i  

Include NFS partitions

-n  

Output list of partitions to be captured only

-p  

parts List of partitions to builds snapshots for

-v  

Output list of partitions to be captured

-x  

Output the usage of this command

hosts  

List of hosts or network pool name

pool 

Your network pool name

These snapshots are then stored in:

$ENLIGHTEN/work/<username>/__<hostname>__/<partition_name>

p_snapdiff

This shows the difference between two snapshots. This command is found in:

$ENLIGHTEN/bin/p_snapdiff

The usage is

./p_snapdiff [-F filename] [-d] [-e filename] [-i filename] [-n|-l|-m] [-r] [-s val1-val2] [-u user] [-x] [-L] [-y]
[-G [+ | -]group] [-M [+ | -]mode] [-P] [-R] [-g group]
[-S [+ | -]size] [-U [+ | -]user] [-p file]
snap1 snap2 ... ...

where the options mean:

-F filename 

Read arguments from filename

-d  

Show content of new/lost directories

-e filename  

Exclude files of this names

-g group  

File must belong to user group

-i filename  

Only include files of this name

-l  

Find lost (removed) files

-m  

Find modified files

-n  

Find new files

-p file  

Use file as alternate password file

-r  

Look for (possibly) renamed files

-s val1-val2  

Only look for file in this size range

-u user  

File must belong to user

-x  

Output this explanation

-y  

Output summary of changes only

-L  

Output filename in long format

-G +/-group  

Group ownership changed to/from group

-M +/-mode  

Permission modes changed

-P  

File has been updated but has retained same size

-R  

File has been read

-S +/-size  

Size has changed by size bytes

-U +/-user  

User ownership changed to/from user

filename  

Name of file containing list of snapshot names

snap1  

Name of first (newer) disk snapshot file

snap2  

Name of second (older) disk snapshot file

Filesystem Comparisons

You can also compare file information from various heterogeneous hosts via the Command Line Interface (CLI). You can see the contents of lost or new directories; view modified, new, and removed files; or even read files.

You can use Sys Admin to check for user and group modified files or any file that has changed permissions. It can compare the current partition snapshot to a previously saved snapshot, or it can compare filesystems to other hosts' partitions running the renld Sys Admin agent daemon.

To take a snapshot, use the p_nsnaps command. To do a comparison of filesystems on different hosts, use the p_snapdiff command.

The following is an example of using the CLI to make snapshots of the /usr filesystem on three systems and then using the CLI to compare the new snapshots against a single /usr partition located on the system apple. This simple shell script can be started by cron at night and the output mailed to the specified user.

#!/bin/sh
ENLIGHTEN=`egrep "^enlighten=" /etc/enlighten | cut "-d=" -f2-`
SNAP=$ENLIGHTEN/bin
WORK=$ENLIGHTEN/work
LOG=$WORK/log
$SNAP/p_nsnaps -p /usr apple taz grumpy
echo `Summary of differences in /usr between apple and taz' > $LOG
$SNAP/p_snapdiff -y $WORK/__apple__/usr $WORK/__taz__/usr >> $LOG
echo `Summary of differences in /usr between apple and grumpy' >> $LOG
$SNAP/p_snapdiff -y $WORK/__apple__/usr $WORK/__grumpy__/usr >> $LOG
/bin/mail root < $LOG

The previous script mailed a copy of the summary output only (-y flag) to admin. The following mail message is the output of this script:

From root Tue Jun 20 18:37 PDT 1995
Date: Tue, 20 Jun 1995 18:37:18 -0700
From: root (0000-Admin(0000))
Apparently-To: admin
Summary of differences between taz and the master
USERNAME   NEW   LOST   REN   +SIZE   -SIZE   MODE   READ   WRITE   +USER   -USER   GRP
root       15    1      0     7       3       1      1341   276     1       0       2
bin        6     0      0     23      5       0      1541   327     0       1       0
lp         0     2      0     6       1       0      22     6       0       0       0
uucp       0     0      0     0       0       0      5      1       0       0       0
adm        0     0      0     0       0       0      0      1       0       0       0
(UID=117)  1     0      0     0       0       0      0      0       0       0       0
sys        0     0      0     0       0       0      0      1       0       0       0

Summary of differences between apple and the master
USERNAME   NEW   LOST   REN   +SIZE   -SIZE   MODE   READ   WRITE   +USER   -USER   GRP
root       119   124    0     847     109     12     0      3367    2       2       5
bin        437   124    0     2090    760     4      0      6013    2       2       1
(UID=101)  0     1      0     0       0       0      0      0       0       0       0
lp         0     6      0     26      13      0      0      184     0       0       0
uucp       0     0      0     17      2       0      0      8       0       0       0
(UID=222)  0     3      0     0       0       0      0      0       0       0       0
adm        0     0      0     0       0       0      0      1       0       0       0
(UID=117)  0     0      0     2       0       0      0      2       0       0       0
sys        0     0      0     0       0       0      0      1       0       0       0
(UID=645)  0     1      0     0       0       0      0      0       0       0       0

The snapshots can also be compared to a single Master by specifying the directory of the Master snapshot instead of the current snapshot. To do so, change the pathname of the snapshot to the master directory: $ENLIGHTEN/work/master/hosts/taz/usr.