sidebar | permalink | keywords | summary |
---|---|---|---|
sidebar |
xcp-smb-reference-scan.html |
netapp, xcp, reference, smb, command, commands |
XCP SMB "scan" command reference |
The SMB scan
command recursively scans the entire SMB share and lists all the files by the end of the scan
command.
xcp scan \\<SMB share path>
The following table lists the scan
parameters and their description.
Parameter | Description |
---|---|
Displays detailed information about how to use the scan command. |
|
Increases debug verbosity. |
|
Specifies the number of concurrent processes (default: <cpu-count>). |
|
Only processes files and directories that match the filter. |
|
Only excludes files and directories in the filter. |
|
Restores the last accessed date on source. |
|
Limits the search depth to n levels. |
|
Lists files in the tree statistic report format. |
|
Lists files in the tree statistic HTML report format. |
|
Lists files in the tree statistic CSV report format. |
|
Lists files in the long listing output format. |
|
Retrieves ownership information of files and directories on the source |
|
Summarizes space usage of each directory including subdirectories. |
|
Formats file listing according to the Python expression (see |
|
Recursively scans the entire SMB share and lists all files and any associated alternate data streams. |
Use the -h
and –-help
parameters with the scan
command to display detailed information about how to use the scan command.
xcp scan --help
Use the -v
parameter with the scan
command to provide detailed logging information to troubleshoot or debug when an error or warning is reported.
xcp scan -v \\<IP address or hostname of SMB server>\source_share
Use the -parallel <n>
parameter with the scan
command to set a higher or lower number of XCP concurrent processes.
Note
|
The maximum value for n is 61. |
xcp scan -parallel <n> \\<IP address or hostname of SMB server>\source_share
Use the -match <filter>
parameter with the scan
command to only process files and directories that match the filter.
xcp scan -match <filter> \\<IP address or hostname of SMB server>\source_share
In the following example, scan -match
scans all files that have changed between one month and one year and prints a line to the console for each file found. The ISO format of its last modification time, a human-readable size of the file, its type, and its relative path are returned for each file.
In the following example, scan -match
lists the files that have not been modified for more than 3 months and have a size bigger than 4MB.
The first of the following two examples only matches the directories and the formatting adds a comma between the variables "mtime", "relative path", and "depth".
The second example redirects the same output to "name.csv".
The following example prints the full path and the raw mtime
value of all the files that are not directories. The mtime
value is padded with 70 characters to facilitate a readable console report.
Use the -exclude <filter>
with the scan
command to exclude directories and files based on the pattern in the filter.
xcp scan -exclude <filter> \\<IP address or hostname of SMB server>\source_share
In the following example, scan -exclude
excludes any file that has changed between one month and one year, and prints a line to the console for each file that is not excluded. The details printed for each file are the ISO format of its last modification time, a human-readable size of the file, its type, and its relative path.
In the following example, scan -exclude
lists the not excluded files that have not been modified for more than three months and have a size greater than 5.5 KB. The details that are printed for each file are the ISO format of its last modification time, a human-readable size of the file, its type, and its relative path.
This following example excludes directories. It lists the not excluded files with formatting that adds a comma between the variables mtime
, relpath
, and depth
.
This following example prints the complete file path and the raw mtimevalue
of all files that are not directories. The mtimevalue
is padded with 70 characters to facilitate a readable console report.
Use the -preserve-atime
parameter with the scan
command to restore the last accessed date of all the files on the source and reset the atime
to the original value before XCP read the file.
When you scan an SMB share, the access time is modified on the files (if the storage system is configured to modify atime
on read) because XCP is reading the files one by one. XCP never changes the atime
, it just reads the file, which triggers an update on atime
.
xcp scan -preserve-atime \\<IP address or hostname of SMB server>\source_share
Use the -depth <n>
parameter with the scan
command to limit the search depth of directories inside an SMB share.
Note
|
The –depth option specifies how deep XCP can scan the files into the subdirectories.
|
xcp scan -depth <2> \\<IP address or hostname of SMB server>\source_share
Use the -stats
parameter with the scan
command to list files in a tree statistics report format.
xcp scan -stats \\<IP address or hostname of SMB server>\source_share
Use the -html
parameter with the scan
command to list files in a HTML statistics report.
Note
|
XCP reports (.csv, .html) are saved in the same location as the XCP binary. The file name is in the format <xcp_process_id>_<time_stamp>.html. When XCP cannot map security identifiers (SIDs) to owner names, it uses the last few digits after the final “–” in the SID to represent the owner. For example, when XCP is unable to map the SID S-1-5-21-1896871423-3211229150-3383017265-4854184 to its owner, it represents the owner by using 4854184. |
xcp scan -stats -html -preserve-atime -ownership \\<IP address or hostname of SMB server>\source_share
Use the -csv
parameter with the scan
command to list files in a CSV tree statistics report.
xcp scan -stats -csv -preserve-atime -ownership \\<IP address or hostname of SMB server>\source_share
Use the -l
parameter with the scan
command to list files in the long listing output format.
xcp scan -l \\<IP address or hostname of SMB server>\source_share
Use the -ownership
parameter with the scan
command to retrieve ownership information for files.
Note
|
You can only use -ownership with the -l , -match , -fmt , or -stats parameters.
|
xcp scan -l -ownership \\<IP address or hostname of SMB server>\source_share
Use the -du
parameter with the scan
command to summarize the space usage of each directory, including subdirectories.
xcp scan -du \\<IP address or hostname of SMB server>\source_share
Use the -fmt <expression>
parameter with the scan
command to format a file listing according to a defined expression.
xcp scan -fmt "', '.join(map(str, [relpath, name, size, depth]))" \\<IPaddress or hostname of SMB server>\source_share
Use the -ads
flag parameter with the scan
command with to recursively scan the entire SMB share and list all files and any associated alternate data streams.
xcp scan -ads \\<source_ip_address>\source_share\src