msfind — Find MSS files.
msfind [-project proj] path [path...] [expression...]
The msfind command recursively descends the directory hierarchy
from each MSS file or directory specified by path, evaluating a
Boolean expression composed of the expressions (described below) for
each MSS file encountered. At least one path must
be specified.
The path operands do not accept
MSS wildcards (shell patterns) for expansion. This will
not be changed in the future. You can get similar behavior
with the -name and/or -path
expressions.
proj
Supply proj as the project number for
charging. Currently, no charging is done for metadata operations, so
this option is a placeholder for when charging might be imposed.
pathA starting point in the directory hierarchy.
expression
The first argument that starts with - (hyphen),
! (bang), or (
(left parenthesis) and all subsequent arguments will be interpreted as an
expression made up of the following primaries and operators. In the
descriptions, wherever n is used as a primary argument, it will
be interpreted as a decimal integer optionally preceded by a plus
(+) or minus (-) sign,
as follows:
+n |
More than n |
n |
Exactly n |
-n |
Less than n |
The following primaries are recognized:
n
True if the difference between the MSS file access (read)
time and the time msfind was started, rounded up to the next
full 24-hour period, is n 24-hour periods.
cos
True if the class of service for a file matches cos.
nTrue if the difference between the MSS file reference time and the time msfind was started, rounded up to the next full 24-hour period, is n 24-hour periods.
Always true. It causes a depth first traversal to be done such that all entries in the directory are acted upon before the directory itself. The default is to act on the directory before the entries in the directory.
cmd [argument ...] ;
True if the invoked DCS command, cmd, returns a zero value
as its exit status. The end of this expression must be terminated
by a semicolon. Note that you may need to escape the semicolon to prevent
your shell from interpreting it, and the semicolon must a separate argument
to the msfind command. An cmd argument containing only the
two characters {} shall be replaced by the current (absolute)
MSS pathname. The current directory of cmd will be the
current directory of msfind. Only other DCS MSS metadata commands
that run on the DCS server may be named as cmd.
project
Evaluates as true if the MSS file project number is
project.
n
True if the difference between the MSS file write time and the
time msfind was started, rounded up to the next full 24-hour
period, is n 24-hour periods.
pattern
True if the basename of the MSS file name being examined matches
pattern as a shell pattern.
file
True if the modification time of the current MSS file is more
recent than the modification time of MSS file file.
pattern
True if the pathname being examined matches pattern as
a shell pattern.
n
True if the retention period (in days) is n.
Always evaluates as true; causes the current pathname to be written to standard output.
Always evaluates as true; causes msfind not to descend the
current path if it is a directory. If depth is specified,
-prune has no effect.
n
Evaluates as true if the initialization time subtracted from
the estimated MSS file purge time is n-1
to n multiples
of 24 hours. Note that the subtraction for purge times is
reversed from other time comparisons since the estimated purge
time is almost always in the future. If the estimated purge time
is in the past, a zero value is substituted for the result of
the subtraction.
n[c]
True if the MSS file size in bytes, divided by 512 and rounded up
to the next integer, is n.
If n is followed by the
character c, the size is in bytes.
c
Evaluates as true if the type of the path is c,
where c is d for
a directory or f for an MSS file.
uname
Evaluates as true if the MSS file belongs to user
uname, which may be either a
scientist number or an MSS user name.
The primaries can be combined using the following operators (in order of decreasing precedence):
expression )True if expression is true.
expressionNegation of a primary; the unary NOT operator.
expression [-and] expression
Conjunction of primaries; the AND operator is implied by the
juxtaposition of two primaries or made explicit by the optional
-and operator. The second expression is not
evaluated if the first is false.
expression -or expressionAlternation of primaries; the OR operator. The second expression is not evaluated if the first expression is true.
If no expression is present, -print is used as the expression.
Example 15. Find MSS files that are going to expire.
Find MSS files that will expire within the next 30 days.
Note that the argument to the -ptime
is -31, which means files that will expire in fewer than
31 days.
msfind /USER -ptime -31
Example 16. Remove selected MSS files with msfind.
Remove all MSS files in a user´s directory that are smaller than 100,000 bytes and are owned by project ´00000000´:
msfind /USER -type f -size -100000c -mproj 00000000 -exec msrm ´{}´ ;Example 17. Find MSS files with specific class of service.
The following example would find all MSS files that have a class of service specifying economy reliability:
msfind /USER/dir -type f -class reliability=economy
See Environment Variables section of the Command Behavior and Envrionment chapter for details.
See Exit Status Codes section of the Command Behavior and Environment chapter for details.