-
On a disk partition, shared with the users who need to use the cache, create a
directory, for example:
mkdir
/home/semirepo/caches/NX1Project
-
Set the permissions on the directory to read/write for the users and groups using the
cache.
chgroup NX1ProjectTeam /home/semirepo/caches/NX1Project
chmod ug+rw /home/semirepo/caches/NX1Project
-
Create a configuration file to store the cache definition. The configuration file must
be accessible to the users who can access the cache. Storing the definition of the cache
in a common location allows you to update the location information if you move the cache.
The configuration file is in JSON format and contains the locations of the cache directory
in this general format:
Note:
The configuration file also stores the aging policy of unused data in the cache.
By default, the system scrubs unused files after 28 days. If you want to change the
aging policy, add the information here as shown.
{
…
"cache": {
"dir": <CACHE_DIR>,
"age": <AGE>
}
}For example:{
…
“cache”: {
“dir”: "/home/semirepo/caches/NX1Project",
"age":90
}
-
Each cache user can use the
DSREPO_CONFIG
environment variable with the location for the configuration file, for
example:
export DSREPO_CONFIG=/home/semirepo/caches/NX1projectcache.cfg
Note:
If there is no central configuration file, the individual cache users set the
DSREPO_CONFIG variable to their own config file. By default, the
system looks for the config file in the following locations in this order:
-
.dsrepo/config subdirectory in the current working directory,
-
$HOME/.dshome/dsrepo/config in the user's home directory,
-
DSREPO_CONFIG environment variable.
Result: Caching is now configured for use. To disable caching, remove the
cache.dir setting from the configuration file, or unset the
DSREPO_CONFIG environment variable that points to the configuration file.