Skip to content

Latest commit

 

History

History
271 lines (194 loc) · 9.92 KB

xcp-smb-reference-scan.adoc

File metadata and controls

271 lines (194 loc) · 9.92 KB
sidebar permalink keywords summary
sidebar
xcp-smb-reference-scan.html
netapp, xcp, reference, smb, command, commands
XCP SMB "scan" command reference

scan

The SMB scan command recursively scans the entire SMB share and lists all the files by the end of the scan command.

Syntax
xcp scan \\<SMB share path>

The following table lists the scan parameters and their description.

Parameter Description

scan -h, –-help

Displays detailed information about how to use the scan command.

scan -v

Increases debug verbosity.

scan -parallel <n>

Specifies the number of concurrent processes (default: <cpu-count>).

scan -match <filter>

Only processes files and directories that match the filter.

scan -exclude <filter>

Only excludes files and directories in the filter.

scan -preserve-atime

Restores the last accessed date on source.

scan -depth <n>

Limits the search depth to n levels.

scan -stats

Lists files in the tree statistic report format.

scan -html

Lists files in the tree statistic HTML report format.

scan -csv

Lists files in the tree statistic CSV report format.

scan -l

Lists files in the long listing output format.

scan -ownership

Retrieves ownership information of files and directories on the source
system.

scan -du

Summarizes space usage of each directory including subdirectories.

scan -fmt <expression>

Formats file listing according to the Python expression (see xcp help -fmt for details).

scan -ads

Recursively scans the entire SMB share and lists all files and any associated alternate data streams.

scan -h, –-help

Use the -h and –-help parameters with the scan command to display detailed information about how to use the scan command.

Syntax
xcp scan --help

scan -v

Use the -v parameter with the scan command to provide detailed logging information to troubleshoot or debug when an error or warning is reported.

Syntax
xcp scan -v \\<IP address or hostname of SMB server>\source_share

scan -parallel <n>

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.
Syntax
xcp scan -parallel <n> \\<IP address or hostname of SMB server>\source_share

scan -match <filter>

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

Syntax
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.

scan -exclude <filter>

Use the -exclude <filter> with the scan command to exclude directories and files based on the pattern in the filter.

Syntax
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.

scan -preserve-atime

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.

Syntax
xcp scan -preserve-atime \\<IP address or hostname of SMB server>\source_share

scan -depth <n>

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.
Syntax
xcp scan -depth <2> \\<IP address or hostname of SMB server>\source_share

scan -stats

Use the -stats parameter with the scan command to list files in a tree statistics report format.

Syntax
xcp scan -stats \\<IP address or hostname of SMB server>\source_share

scan -html

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.
Syntax
xcp scan -stats -html -preserve-atime -ownership \\<IP address or hostname of SMB server>\source_share

scan -csv

Use the -csv parameter with the scan command to list files in a CSV tree statistics report.

Syntax
xcp scan -stats -csv -preserve-atime -ownership \\<IP address or hostname of SMB server>\source_share

scan -l

Use the -l parameter with the scan command to list files in the long listing output format.

Syntax
xcp scan -l \\<IP address or hostname of SMB server>\source_share

scan -ownership

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.
Syntax
xcp scan -l -ownership \\<IP address or hostname of SMB server>\source_share

scan -du

Use the -du parameter with the scan command to summarize the space usage of each directory, including subdirectories.

Syntax
xcp scan -du \\<IP address or hostname of SMB server>\source_share

scan -fmt <expression>

Use the -fmt <expression> parameter with the scan command to format a file listing according to a defined expression.

Syntax
xcp scan -fmt "', '.join(map(str, [relpath, name, size, depth]))" \\<IPaddress or hostname of SMB server>\source_share

scan -ads

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.

Syntax
xcp scan -ads \\<source_ip_address>\source_share\src