source: gpfs_3.1_ker2.6.20/lpp/mmfs/samples/util/README @ 152

Last change on this file since 152 was 16, checked in by rock, 17 years ago
File size: 10.1 KB
Line 
1Disclaimers
2-----------
3
4The files in this directory are provided by IBM on an "AS IS" basis
5without warranty of any kind.
6
7
8Introduction
9------------
10
11The files in this directory contain generally useful utilities that use
12GPFS specific APIs to scan filesystem metadata.  The source code is provided
13to give examples of how to use some of the APIs.  Execution of these commands
14requires root authority.
15
16
17Utilities
18---------
19tsgetusage   - Fast scan of all files in a filesystem and calculate how
20               much disk space is used by each unique user and/or group.
21
22tsinode      - Fast scan of all files in a filesystem and display one line
23               of ls information about each one.
24
25tslistall    - Fast scan of all files in a filesystem and display one line
26               of inodenumber pathname type ctime mtime
27
28tsfindinode  - Fast parallel scan of all directories in a filesystem
29               listing inodenumber type pathname for each inode specified
30
31tsreaddir    - Fast parallel scan of all directories in a filesystem
32               listing inodenumber type pathname for each file
33               (used by tslistall)
34
35tstimes      - Fast scan of all files in a filesystem and display one line
36               of inode mtime ctime for each file
37               (used by tslistall)
38
39tsbackup     - Fast parallel backup utility using multiple TSM clients
40               and a single TSM server.  Parallelism is achieved via
41               the use of multi-threading and the use of multiple TSM
42               client processes.  This utility makes use of the GPFS
43               inode scan APIs.
44
45
46------------------------------------------------------------------------------
47
48tsgetusage   - Fast scan of all files in a filesystem and calculate how
49               much disk space is used by each unique user and/or group.
50
51  Usage:  tsgetusage [-g][-h][-q][-v][-u][-H hashTableSize] fsPath
52
53          where:  fsPath  path to file system
54                  -u      outputs data in diskusg format for acctdisk
55                  -g      collect stats for groups
56                  -H      sets the hash table size (default 1027)
57                  -h      prints this message
58                  -q      outputs only the resulting stats
59                  -v      print information about each file
60
61    Using the -u option will produce a file with a format like
62    /usr/sbin/acct/diskusg that is used for other types of filesystems.
63    This can be used as input to the /usr/sbin/acct/acctdisk program, and then
64    merged with the other disk accounting data using /usr/sbin/acct/acctmerg.
65
66    For more information about the AIX Accounting System, the preparation
67    of daily and monthly reports, and the accounting files, see the AIX
68    Accounting Overview.
69
70
71------------------------------------------------------------------------------
72
73tsinode      - Fast scan of all files in a filesystem and display one line
74               of information about each one.
75
76  Usage:  tsinode fsPath [startinode [endinode]]
77
78          where:  fsPath      path to file system
79                  startinode  first inode number to be listed
80                  endinode    last inode number to be listed
81
82  Hint:
83    For the best performance on a filesystem with millions of inodes,
84    run several copies of tsinode with different inode ranges and
85    concatenate the output files.
86
87
88------------------------------------------------------------------------------
89
90tsfindinode  - Fast parallel scan of all directories in a filesystem
91               listing: inodenumber pathname
92
93  Usage:  tsfindinode {-i {inum | inumfile}} [-t nThreads] [--] fsPath
94
95          where:  fsPath       path to file system
96                  -i inum      adds one inode number to the list
97                               (this can be used multiple times)
98                  -i inumfile  names a file containing inode numbers
99                               to be added to the list
100                               (this can be used multiple times)
101                  -t           set the number of threads (default = 16)
102                  --           marker so that names starting with "-"
103                               are not treated like options.
104
105This program recursively traverses the directory structure to list all
106accessible files and directories in the file system whose inode numbers
107match those specified in the list of inodes.  Each file prints one line
108on stdout containing the file's inode number, and the pathname to the
109file.  The number and names are separated by a tab character.
110The starting directory is listed with the pathname given as the argument.
111All other lines have pathnames relative to the starting directory.
112
113The program uses the GPFS directory scan interface to quickly read the
114directory entries without calling "stat" on each file.  The directories
115are scanned in parallel by multiple threads which results in an unsorted
116output file.  Inode numbers that are not found in the tree are printed to
117stderr with the name "(notfound)".
118
119Example:
120
121>tsfindinode -i 23612 -i 1452 -i 47666 /gpfs
122     23612  include/stdio.h
123      1452  include/curses.h
124     47666  (notfound)
125>
126
127
128------------------------------------------------------------------------------
129
130tslistall    - Fast scan of all files in a filesystem and display one line
131               per file with the following information:
132                 inodenumber/generation mtime ctime type pathname
133
134  Usage:  tslistall fsPath  [tmpdirname]
135
136          where:  fsPath      path to file system
137                  tmpdirname  is a directory where intermediate files for sort
138                              can be generated. The default directory id /tmp.
139                              This is necessary for GPFS filesystem that have
140                              large numbers of files.
141
142This is a shell script that invokes tsreaddir and tstimes
143then merges the resulting files.  The output is printed to stdout
144with 1 line per file and is sorted by inode number.
145
146By saving the output of this command, you can compare it with a later list
147to find out what has changed in the filesystem since the old list was made.
148
149Example:
150
151>tslistall /gpfs
1520000000003/0000000001 1012390401.913049600  1012390401.913049600  DIR /gpfs
1530000001452/0000000003 1024702059.694025000  1024702059.694025000  LNK include/curses.h
1540000001812/0000000000 1024702015.294047000  1024702015.294047000  DIR include
1550000019578/0000000000 1026797433.109149000  1026794560.584238000  REG mail.rc
1560000023612/0000000017 1024702090.705801000  1024702090.705801000  REG include/stdio.h
1570000023874/0000000000 1024702024.982645000  1024702024.982645000  REG include/string.h
158>
159
160
161------------------------------------------------------------------------------
162
163tsreaddir    - Fast parallel scan of all directories in a filesystem
164               listing inodenumber type pathname
165
166  Usage:  tsreaddir [-d] [-n] [-t nThreads] [--] fsPath
167
168          where:  fsPath  path to file system
169                  -d      list only directories.
170                  -n      do not list directories.
171                  -t      set the number of threads (default = 16)
172                  --      marker so that names starting with "-"
173                          are not treated like options.
174
175This program recursively traverses the directory structure
176to list all accessible files and directories in the file system.
177Each file prints one line on stdout containing the file's inode number,
178the generation number, the file's type and the pathname
179to the file.  The fields are separated by tab characters.
180If directories are listed, the starting directory is listed with
181the pathname given as the argument.  All other lines have pathnames
182relative to the starting directory.
183
184The file types are "DIR" for directories, "REG" for regular
185files, "LNK" for symbolic links and "UNK" for all others.
186If the -d option is specified only directories are listed,
187and if the -n option is specified directories are not included in
188the output list.
189
190The program uses the GPFS directory scan interface to quickly read the
191directory entries without calling "stat" on each file.  The directories
192are scanned in parallel by multiple threads which results in an unsorted
193output file.
194
195Example:
196
197>tsreaddir /gpfs
1980000000003/0000000001 DIR /gpfs
1990000001812/0000000000 DIR include
2000000023612/0000000017 REG include/stdio.h
2010000023874/0000000000 REG include/string.h
2020000001452/0000000003 LNK include/curses.h
2030000019578/0000000000 REG mail.rc
204>
205
206
207------------------------------------------------------------------------------
208
209tstimes      - Fast scan of all files in a filesystem and display one line
210               of inode mtime ctime for each file
211
212  Usage:  tstimes fsPath
213
214          where:  fsPath  path to file system
215
216This program performs a gpfs inode scan on the specified file system
217to obtain the mtime and ctime for each file.  The results are output
218on stdout, with one line per file containg the inode number, the
219generation number, the mtime seconds and nanoseconds GMT, and the ctime seconds
220and nanoseconds GMT.  The output file is sorted by the inode numbers.
221The fields are separated by tab characters.
222
223Example:
224
225>tstimes /gpfs
2260000000003/0000000001   1012390401.913049600    1012390401.913049600
2270000001452/0000000003 1024702059.694025000  1024702059.694025000
2280000001812/0000000000 1024702015.294047000  1024702015.294047000
2290000019578/0000000000 1026797433.109149000  1026794560.584238000
2300000023612/0000000017 1024702090.705801000  1024702090.705801000
2310000023874/0000000000 1024702024.982645000  1024702024.982645000
232>
233
234
235------------------------------------------------------------------------------
236
237mmbackup/tsbackup (see documentation for mmbackup in the GPFS Admin Guide)
238
239tsbackup     - Fast parallel backup utility using multiple TSM clients
240               and a single TSM server.  Parallelism is achieved via
241               the use of multi-threading and the use of multiple TSM
242               client processes.  This utility makes use of the GPFS
243               inode scan APIs.
244
245  Usage:
246    mmbackup Device -n ControlFile [-t {full | incremental}] [-r IOrate]
247      or
248    mmbackup Device -R [-r IOrate]
249
250Parts:
251
252tsbackup.C       (sample code in this directory)
253tsbackup.h       (sample code in this directory)
254mmbackup.sh      (script in /usr/lpp/mmfs/bin)
255mmexectsmcmd.sh  (script in /usr/lpp/mmfs/bin)
256
Note: See TracBrowser for help on using the repository browser.