Skip to main content
XCP

chmod

Contributors netapp-aoife

The XCP NFS chmod command scans and changes the file permission of all the files for the given directory structure. The 'chmod' command requires mode or reference, NFS share, or the POSIX path as a variable. The XCP chmod command recursively changes the permissions for a given path. The command output displays the total files scanned and the permissions changed in the output.

Syntax
xcp chmod -mode <value> <source NFS export path>
Show example
[root@user-1 linux]# ./xcp chmod -mode <IP address>:/source_vol

Xcp command : xcp chmod -mode <IP address>://source_vol
Stats : 6 scanned, 4 changed mode
Speed : 1.96 KiB in (2.13 KiB/s), 812 out (882/s)
Total Time : 0s.
STATUS : PASSED
[root@user-1 linux] #

The following table lists the chmod parameters and their description.

Parameter Description

chmod -exclude <filter>

Excludes the files and directories that match the filter.

chmod -match <filter>

Only processes the files and directories that match the filter.

chmod -reference <reference>

Specifies the referenced file or directory point.

chmod -v

Reports the output for every object processed.

chmod -exclude <filter>

Use the -exclude <filter> parameter with the chmod command to exclude the files and directories that match the filter.

Syntax
xcp chmod -exclude <filter> -mode <value> <source NFS export path>
Show example
[root@user-1 linux]# ./xcp chmod -exclude "fnm('3.img')" -mode 770 101.11.10.10:/s_v1/D3/

Excluded: 1 excluded, 0 did not match exclude criteria
Xcp command : xcp chmod -exclude fnm('3.img') -mode 770 101.11.10.10:/s_v1/D3/
Stats : 5 scanned, 1 excluded, 5 changed mode
Speed : 2.10 KiB in (7.55 KiB/s), 976 out (3.43 KiB/s)
Total Time : 0s.
STATUS : PASSED
[root@user-1 linux]#

chmod -match <filter>

Use the -match <filter> parameter with the chmod command to only process the files and directories that match the filter.

Syntax
xcp chmod -match <filter>  -mode <value> <source NFS export path>
Show example
[root@user-1 linux]# ./xcp chmod -match "fnm('2.img')" -mode 777 101.11.10.10:/s_v1/D2/

Filtered: 1 matched, 5 did not match
Xcp command : xcp chmod -match fnm('2.img') -mode 101.11.10.10:/s_v1/D2/
Stats : 6 scanned, 1 matched, 2 changed mode
Speed : 1.67 KiB in (1.99 KiB/s), 484 out (578/s)
Total Time : 0s.
STATUS : PASSED
[root@user-1 linux]

chmod -reference <reference>

Use the -reference <reference> parameter with the chmod command to specify the referenced file or directory point.

Syntax
xcp chmod -reference <reference> <source NFS export path>
Show example
[root@user-1 linux]# ./xcp chmod -reference 101.11.10.10:/s_v1/D1/1.txt 102.21.10.10:/s_v1/D2/

Xcp command : xcp chmod -reference 101.11.10.10:/s_v1/D1/1.txt 102.21.10.10:/s_v1/D2/
Stats : 6 scanned, 6 changed mode
Speed : 3.11 KiB in (3.15 KiB/s), 1.98 KiB out (2.00 KiB/s)
Total Time : 0s.
STATUS : PASSED
[root@user-1 linux]#

chmod -v

Use the -v parameter with the chmod command to report the output for every object processed.

Syntax
chmod -mode <value> -v <source NFS export path>
Show example
[root@user-1 linux]# ./xcp chmod -mode 111 -v file:///mnt/s_v1/D1/

mode of 'file:///mnt/s_v1/D1' changed from 0777 to 0111
mode of 'file:///mnt/s_v1/D1/1.txt' changed from 0777 to 0111
mode of 'file:///mnt/s_v1/D1/softlink_1.img' changed from 0777 to 0111
mode of 'file:///mnt/s_v1/D1/softlink_to_hardlink_1.img' changed from 0777 to 0111 mode
of 'file:///mnt/s_v1/D1/1.img' changed from 0777 to 0111
mode of 'file:///mnt/s_v1/D1/hardlink_1.img' changed from 0777 to 0111 mode of
'file:///mnt/s_v1/D1/1.img1' changed from 0777 to 0111
Xcp command : xcp chmod -mode 111 -v file:///mnt/s_v1/D1/ Stats : 7 scanned, 7
changed mode
Speed : 0 in (0/s), 0 out (0/s)
Total Time : 0s.
STATUS : PASSED
[root@user-1 linux]#