list projects or setup a project tree for tree quota management
Example:
'project -c logfiles'
(match project 'logfiles' to a directory, and setup the directory tree)
Without arguments, report all projects found in the /etc/projects file.
The project quota mechanism in XFS can be used to implement a form of
directory tree quota, where a specified directory and all of the files
and subdirectories below it (i.e. a tree) can be restricted to using a
subset of the available space in the filesystem.
A managed tree must be setup initially using the -c option with a project.
The specified project name or identifier is matched to one or more trees
defined in /etc/projects, and these trees are then recursively descended
to mark the affected inodes as being part of that tree - which sets inode
flags and the project identifier on every file.
Once this has been done, new files created in the tree will automatically
be accounted to the tree based on their project identifier. An attempt to
create a hard link to a file in the tree will only succeed if the project
identifier matches the project identifier for the tree. The xfs_io utility
can be used to set the project ID for an arbitrary file, but this can only
be done by a privileged user.
A previously setup tree can be cleared from project quota control through
use of the -C option, which will recursively descend the tree, clearing
the affected inodes from project quota control.
The -c option can be used to check whether a tree is setup, it reports
nothing if the tree is correct, otherwise it reports the paths of inodes
which do not have the project ID of the rest of the tree, or if the inode
flag is not set.
The -p <path> option can be used to manually specify project path without
need to create /etc/projects file. This option can be used multiple times
to specify multiple paths. When using this option only one projid/name can
be specified at command line. Note that /etc/projects is also used if exists.
The -d <depth> option allows to descend at most <depth> levels of directories
below the command line arguments. -d 0 means only apply the actions
to the top level of the projects. -d -1 means no recursion limit (default).
The /etc/projid and /etc/projects file formats are simple, and described
on the xfs_quota man page.