The NSS File System Metadata Migration Utility (METAMIG) for Linux allows you to save and restore NSS file system trustee, user quota, and directory quota metadata for eDirectory and AD (Active Directory) users.
METAMIG is located in the /opt/novell/nss/sbin/metamig directory.
metamig [OPTIONS]
metamig save volume [SOPTIONS]
metamig restore volume [ROPTIONS]
The first argument indicates the action to be taken on the specified NSS volume. Possible actions are Save and Restore.
Argument |
Description |
---|---|
save |
Saves the indicated metadata to stdout. |
restore |
Restores the indicated metadata to stdin. |
The second argument specifies the NSS volume name to be saved or restored.
The third argument specifies the path to a file. This is the file to be created on save, or the file to be restored from on restore.
Several option types are available:
The following options are general options available to actions related to save or restore.
Option |
Description |
---|---|
-v, --version |
Displays the program version information. |
-h, --help |
Displays the help screen. |
The following options are options available to actions related to save.
Option |
Description |
---|---|
-m, --meta=MASK |
The types of metadata to be saved. By default, all the types of metadata are included and all the trustees are retained. For information, see MASK. |
-u, --usertype=TYPE |
Saves the metadata based on the eDirectory or AD user. If this option is not specified, both eDirectory and AD users are included by default. For information, see TYPE. NOTE:The option "-u ad" cannot be used with the option "-n". |
-p, --path |
Exports the settings of all the files under a given path. |
-n, --ncp |
Saves the trustee metadata from the NCP Trustee database instead of parsing the volume to generate the data. Use this option only if you are confident that the NCP Trustee database is available and current. For example, if the NCP Server has been turned off and its database is not yet resynchronized with the volume, do not use this command option until the database is again current. |
The following options are options available to actions related to restore.
Option |
Description |
---|---|
-a, --actions |
Display all actions taken |
-m, --meta=mask |
The types of metadata to be restored. By default, all the types of metadata are included and all the trustees are retained. For information, see MASK. |
-f, --filter=regexp |
A filter that restores only files and directories that match the specified regular expression. Use a regular expression to specify one or more files and directories to be restored. For example, to set the criteria to restore only files with names that start with the letter “a”, use this option: --filter=.*/a.* However, if you have used the NCP trustee database to save the metadata, then use this option: --filter=.*\\a.* to set the criteria to restore only files with names that start with the letter “a”. Please refer to a programming textbook or search the Internet for information about how to construct regular expressions. |
-u, --usertype=TYPE |
Restores the metadata based on the eDirectory or AD user. If this option is not specified, both eDirectory and AD users are included by default. For information, see TYPE. NOTE:The option "-u ad" cannot be used with the option "-n". |
-t, --tree=treename |
If this value is specified, this setting overrides the saved directory treename. |
-n, --ncp |
Builds a new NCP trustee file from trustee data. This automatically disables restoration of quotas. |
-d, --details |
Displays all actions taken. |
-w, --inputfilefromnetware |
Specify this option if the input file is generated by TRUSTEE.NLM on the NetWare 6.5 SP8 server. |
-r, --relativepathprefix |
Specifies the reference location of the OES server for the relative path, if the input file is generated by TRUSTEE.NLM on NetWare server with /R switch. TRUSTEE.NLM /R option puts relative path for file in its output. |
The mask is a string of characters with each character representing a type of NSS file system metadata. Use the mask to specify values for the meta parameter in SOptions (Save) and ROptions (Restore). If no mask is specified, only t, u and d are considered as the default parameters.
Option |
Description |
---|---|
t |
Trustees |
u |
User quotas |
d |
Directory quotas |
a |
All metadata |
r |
Removes unknown trustees from the filesystem. This works only for save and not for the restore operations. |
The type is a string representing the different user type. Use the type to specify values for the usertype parameter in SOptions (Save) and ROptions (Restore).
Option |
Description |
---|---|
edir |
eDirectory users |
ad |
Active Directory users |
To save the user quota data and directory quota data for a volume called VOL1 in the /backup/volquotas file, enter
metamig save VOL1 -m ud >/backup/volquotas
To restore the user quota data from the file /backup/volquotas to VOL1, enter
metamig restore VOL1 -m u </backup/volquotas
To restore the trustee data from the file /backup/trustees, enter
metamig restore vol1 -m t -r dir1/dir2 -w -t TREENAME </backup/trustees
If trustees are backed up at a volume level using trustee.nlm with /R switch and all the source volume data is copied to the directory /media/nss/<volume>/dir1 on target volume, then -r should be dir1. If all the source volume data is copied to the root of the target volume /media/nss/<volume> then -r should be "/" or ".".
metamig save NSSVOL > unfiltered.xml
This command exports the setting of all the files under the volume NSSVOL.
metamig -p dir1 save NSSVOL > filtered.xml
This command exports the settings of all the files under the dir1 directory only
metamig save VOL1 -m a -u ad >/backup/adtrustees
This command saves all the metadata for AD users.
metamig restore VOL1 -m t -u edir </backup/trustees
This command restores the trustee data for eDirectory users.