| 1 |
lange |
304 |
.\" Hey, EMACS: -*- nroff -*- |
| 2 |
|
|
.TH fcopy 8 "Jan 8,2001" |
| 3 |
|
|
.\" Please adjust this date whenever revising the manpage. |
| 4 |
|
|
.\" |
| 5 |
|
|
.\" Some roff macros, for reference: |
| 6 |
|
|
.\" .nh disable hyphenation |
| 7 |
|
|
.\" .hy enable hyphenation |
| 8 |
|
|
.\" .ad l left justify |
| 9 |
|
|
.\" .ad b justify to both left and right margins |
| 10 |
|
|
.\" .nf disable filling |
| 11 |
|
|
.\" .fi enable filling |
| 12 |
|
|
.\" .br insert line break |
| 13 |
|
|
.\" .sp <n> insert n+1 empty lines |
| 14 |
|
|
.\" for manpage-specific macros, see man(7) |
| 15 |
|
|
.SH NAME |
| 16 |
|
|
fcopy \- copy files using classes |
| 17 |
|
|
.SH SYNOPSIS |
| 18 |
|
|
.B fcopy |
| 19 |
|
|
.RI [ options ] " SOURCE" ... |
| 20 |
|
|
.SH DESCRIPTION |
| 21 |
|
|
Copy a file from SOURCE to its target using classes. |
| 22 |
lange |
317 |
It also sets permission modes, owner and group. |
| 23 |
lange |
304 |
Each SOURCE argument is a directory, which contains one or more |
| 24 |
|
|
template files for the source file to copy. Depending on the list of |
| 25 |
lange |
317 |
defined classes, one file of the source directory is selected and |
| 26 |
lange |
304 |
copied to the target. The target filename is the name of the source |
| 27 |
|
|
directory. |
| 28 |
|
|
|
| 29 |
|
|
The exit code returned by fcopy is 0 if all files are copied |
| 30 |
|
|
successfully and >0 if an error occurs. For every successfully copied |
| 31 |
|
|
file, a log message is printed to standard output. |
| 32 |
|
|
.SH OPTIONS |
| 33 |
|
|
.TP |
| 34 |
lange |
369 |
Options -c, -s, -t (or their analog variables) and a SOURCE are required. |
| 35 |
lange |
317 |
.TP |
| 36 |
lange |
304 |
.BI "\-c " class[,class] |
| 37 |
|
|
Define classes. Multiple classes must be comma separated. If not |
| 38 |
|
|
specified, use the shell environment variable $classes (space separated). |
| 39 |
|
|
.TP |
| 40 |
|
|
.BI "\-C " file |
| 41 |
|
|
Read classes from \fIfile\fR. Lines can contain multiple classes which are space separated. Lines starting with # are comments. |
| 42 |
|
|
.TP |
| 43 |
|
|
.B \-d |
| 44 |
lange |
369 |
Delete target file, if no class applies. |
| 45 |
|
|
.TP |
| 46 |
|
|
.B \-D |
| 47 |
lange |
317 |
Create debugging output. |
| 48 |
lange |
304 |
.TP |
| 49 |
|
|
.BI "\-F " file |
| 50 |
|
|
Read list of sources from \fIfile\fR. One SOURCE per line. |
| 51 |
|
|
.TP |
| 52 |
|
|
.B \-h |
| 53 |
lange |
317 |
Show help, version and summary of options. |
| 54 |
lange |
304 |
.TP |
| 55 |
|
|
.BI "\-m " user,group,mode |
| 56 |
lange |
317 |
Set user, group and mode for all copied files (mode as octal number, user and |
| 57 |
|
|
group numeric id or name). If not specified, use file file-mode or data of source file. |
| 58 |
lange |
304 |
.TP |
| 59 |
|
|
.B \-r |
| 60 |
lange |
317 |
Copy recursively (traverse down the tree). Copy all files below |
| 61 |
|
|
SOURCE. These are all subdirectories leaves in the SOURCE tree. |
| 62 |
lange |
304 |
.TP |
| 63 |
|
|
.BI "\-s " source_dir |
| 64 |
lange |
317 |
Look for SOURCE files relative to \fIsource_dir\fR. Use $FAI_FILES if |
| 65 |
|
|
not specified. |
| 66 |
lange |
304 |
.TP |
| 67 |
|
|
.BI "\-t " target_dir |
| 68 |
lange |
317 |
Copy files relativ to \fItarget_dir\fR. Use $FAI_ROOT if not specified. |
| 69 |
lange |
304 |
.TP |
| 70 |
|
|
.B \-v |
| 71 |
|
|
Create verbose output. |
| 72 |
|
|
|
| 73 |
lange |
317 |
|
| 74 |
lange |
304 |
.SH EXAMPLES |
| 75 |
|
|
.br |
| 76 |
|
|
Suppose the source directory /files/etc/X11/XF86Config consists of following files: |
| 77 |
|
|
|
| 78 |
lange |
317 |
CAD DEFAULT LAB MACH64 server1 faifoo file-modes |
| 79 |
lange |
304 |
|
| 80 |
|
|
Each file is an instance of a XF86Config file for a different |
| 81 |
|
|
xserver configuration except file-modes, |
| 82 |
|
|
which holds the file creation data. The command |
| 83 |
|
|
|
| 84 |
|
|
# fcopy -s /files -t /tmp/target /etc/X11/XF86Config |
| 85 |
|
|
|
| 86 |
lange |
317 |
copies one of these files from the directory /files/etc/X11/XF86Config to |
| 87 |
|
|
the file /tmp/target/etc/XF86Config. For all defined classes, fcopy looks if a |
| 88 |
|
|
corresponding file exists. The last matching class will be used |
| 89 |
|
|
for copying. Here are examples of defined classes and the file which will be copied |
| 90 |
|
|
by fcopy. |
| 91 |
lange |
304 |
|
| 92 |
|
|
.sp |
| 93 |
|
|
.nf |
| 94 |
lange |
317 |
.ta 40n |
| 95 |
|
|
Defined classes File used for copy |
| 96 |
lange |
304 |
|
| 97 |
lange |
317 |
DEFAULT,LAB,server3 LAB |
| 98 |
|
|
DEFAULT,CAD,server1 server1 |
| 99 |
|
|
DEFAULT,MACH64,faiclient01 MACH64 |
| 100 |
|
|
DEFAULT,TFT,faiclient13 DEFAULT |
| 101 |
lange |
304 |
.sp |
| 102 |
|
|
.fi |
| 103 |
|
|
.PP |
| 104 |
|
|
|
| 105 |
|
|
In FAI (look at SEE ALSO) the list of defined classes starts with DEFAULT and the |
| 106 |
|
|
last class is the hostname. So DEFAULT is only used, when no file for |
| 107 |
|
|
another class exists. If a file is equal to the hostname, this |
| 108 |
|
|
will be used, since hostname should always be the last class. |
| 109 |
|
|
|
| 110 |
|
|
User, group and permissions for the files can be defined in several |
| 111 |
|
|
ways. Option -m has the highest priority and will be used for all |
| 112 |
|
|
files, if specified. The file file-modes in the source directory can |
| 113 |
|
|
contain one line for each class. The space separated parameter are: |
| 114 |
|
|
|
| 115 |
|
|
owner group mode class |
| 116 |
|
|
|
| 117 |
lange |
317 |
where owner and group can be specified by numeric id or by name. If |
| 118 |
|
|
class is missing, the data is used for all other classes, for which no |
| 119 |
|
|
data is defined. If neither -m or file-modes data is available, the |
| 120 |
|
|
user, group and mode of the source file will be used for the target |
| 121 |
|
|
file. |
| 122 |
lange |
304 |
|
| 123 |
lange |
317 |
Missing subdirectories for the target file are created with mode |
| 124 |
|
|
0755. If the destination file already exists and is different from the |
| 125 |
|
|
source file, the suffix .pre_fcopy is appended to the old version of |
| 126 |
|
|
the target file. If source and target files are equal, no copy is performed. |
| 127 |
|
|
A copied file gets the same access and modification time as the source file, not |
| 128 |
|
|
the time of the copy. |
| 129 |
|
|
|
| 130 |
lange |
304 |
.SH NOTES |
| 131 |
lange |
317 |
Do not create a file DEFAULT, if no reasonable default configuration file can be |
| 132 |
lange |
304 |
used. It's better to exit with an error, than to copy a wrong |
| 133 |
|
|
configuration file. |
| 134 |
|
|
|
| 135 |
|
|
This command can also be used to maintain your configuration files on |
| 136 |
lange |
317 |
a huge number of hosts. |
| 137 |
lange |
304 |
.SH SEE ALSO |
| 138 |
|
|
.br |
| 139 |
|
|
The programs is part of FAI (fully automatic installation). See the FAI manual |
| 140 |
|
|
for more information how to use fcopy. The FAI homepage is http://www.informatik.uni-koeln.de/fai. |
| 141 |
|
|
|
| 142 |
|
|
.SH AUTHOR |
| 143 |
lange |
343 |
Thomas Lange <lange@informatik.uni-koeln.de> |