File Level Analytics - Command Line - CSV
The approach to running File-Level Analytics commands that this page describes is not the preferred method for obtaining this information. The method described on File Level Analytics - Command Line - XML gives you greater flexibility and more information, and we recommend using the XML-based method whenever possible.
Running File Level Analytics
File Level Analytics commands based on getbackuplist can be run on both Windows and Unix MediaAgents. getbackuplist can be run based either on subclient or job ID.
The results of subclient-based commands and Job ID-based commands differ as follows:
- Subclient-based commands display file-level details of all files from the latest backup cycle of the selected subclient.
- Job ID-based command displays file-level details of the specific job only.
You can specify different parameters to display the results.
If the command line query is run on a client where there is no MediaAgent, any user running the command at the client level is able to run the command against that client only.
The sections below describe usage for both command types and the mandatory parameters required by each.
Usage
- If you are using a Windows MediaAgent, navigate to <Software_Installation_Directory>/Base folder from the Command prompt.
If you are using a Unix MediaAgent, navigate to any folder except the root folder /folder name from the Command prompt.
- Run one of the following commands:
Subclient Based Command
Job ID Based Command
Mandatory Parameters for Subclient Based Command
The following parameters are mandatory for the subclient-based query:
- client name
- app type
- subclient name
- output file
Example
Notes
- If no backupset is provided, the default backupset is considered.
- If there are two subclients with the same name on the client, then you must specify a backupset.
- If you run a query on a virtual machine, then you must specify the instance name with the -vm parameter.
- If format is not specified then full file name, file size and modified date of the file is provided in the CSV format in the output file.
- If unixtime stamp is not specified, human readable time will be printed in the output.
- If a MediaAgent is specified, the index will be downloaded to that MediaAgent and then the query will be processed on this MediaAgent.
If not specified, the MediaAgent where the backup job ran would be used for processing the query.
- If no pattern file is specified everything is considered.
Mandatory Parameters for Job ID Based Command
The following parameters are mandatory for the Job ID-based query:
- Jobid
- outfile
Example
Help
- If you are using a Windows MediaAgent, navigate to <Software_Installation_Directory>/Base folder from the Command prompt.
If you are using a Unix MediaAgent, navigate to any folder except the root folder /folder name from the Command prompt.
- Run the following command:
Available Command Parameters
Parameter | Description of Parameter Values | ||||||||
-client | Name of the client on which the data protection job is run. | ||||||||
-appType | Application type of the corresponding subclient. All Agents are supported. | ||||||||
-instance | Name of the instance in the client computer on which the data protection job is run. Note that this parameter is optional as not all Agents have instances. If your Agent does not support instances, then do not list the parameter in the command.
For all Exchange Agents, make sure to include the instance parameter and specify defaultInstance as the value. Exchange Agents will always use the default instance. |
||||||||
-backupset | Name of the backupset in the client computer on which the data protection job is run. | ||||||||
-subclient | Subclient name of the subclient which contains the backup data. | ||||||||
-jobId | Job id of the job whose file level information needs to be established. | ||||||||
-outfile | File name and location of the output file in which the output will be displayed. | ||||||||
-ma | Fully qualified domain name of the MediaAgent computer. This needs to be the host name as specified in the CommCell Console. | ||||||||
-where | Clause used to run the query. The following arguments can be used with the where clause.
The following operators can be used:
|
||||||||
-format | Format in which the information will be presented in the output. The following arguments can be used to specify the format for output file.
|
||||||||
-patternfile | This is an input file. Specify the location of the pattern file with file name. If - pattern file is not specified, then “\**\*” (everything) is used. If more than one pattern needs to be matched, multiple patterns need to be provided within the patternfile. Pattern file can contain patterns based on the wild card support. See Wildcards for detailed information. |
||||||||
-vm | Name of the instance. | ||||||||
-unixtime | If used, time in output file will be displayed in unix time format. | ||||||||
-commcellid | This parameter is used with queries based on job id. | ||||||||
-commcell | CommCell name which holds the client. This parameter works with subclient based queries. | ||||||||
–dbjob | Used to get the backup list for databases (Oracle, Sybase, Informix,DB2, SAP for Oracle). This works along with -jobId parameter. |
Examples of Client Name and Subclient Name Based Commands
Following are some examples of client name and subclient name-based commands using getbackuplist. These command use a combination of client name, subclient name and backupset, and the combination remains unique within the CommCell. However, if no BackupSet name is provided, it is assumed that the default BackupSet is used.
All Files Backed Up by A Subclient
You can use the following examples to display file level information of a subclient from the default Backup Set, when no Backup Set name is provided. By default, the output will contain full file path size and the modified date if no format is provided. The output contains all of the data that has been backed up in the latest cycle for the subclient.
Windows
Unix
Output for Windows and Unix
File Name, Modified Time , Access Time and File Size
You can use the following examples to get a list of files that displays filename, modified time, access time and file size in the output:
Windows
Unix
Output for Windows and Unix
File Name, Modified Time, Access Time, File Size and the MediaAgent to Use
You can use the following examples on any client to get a list of files from the latest index on the MediaAgent that you specify. This query displays the file name, modified time, access time, and file size in the output. If the index for the last cycle is present on the specified MediaAgent, then the query runs on that index. If there is no index on the specified MediaAgent, the latest index will be restored and then queried.
Windows
Unix
Output for Windows and Unix
Time Stamps in Unix Time Format for the Modified and Access Times
You can use the following examples to display time stamps in Unix time formats for the modified and access times in the output, instead of human readable formats.
Windows
Unix
Output for Windows and Unix
Files with File Size Greater Than 10240000 Bytes
You can use the following examples to retrieve a list of files whose file size is greater than 10240000 bytes where output format would be in filename, modified time, and file size.
Windows
Unix
Output for Windows and Unix
Files with File Size Greater Than 10 MB and Specific Modified and Access Time
You can use the following examples to display a list of files with a file size greater than 10 MB, a modified time later than 02 Jun 2006 14:54:56 GMT, and an access time later than 14 Aug 2012 13:37:08 GMT. The output format would contain the file name, modified time, file size and access time information from the specified subclient in the latest cycle.
Windows
Unix
Output for Windows and Unix
Files That Are Backed Up in Any Folder by the Subclient with ".exe" as an Extension
You can use the following examples to display a list of all files that are backed up in any folder by the specified subclient, have ".exe" for an extension, and that meet all criteria that are specified in the where clause. For example: file size greater than 10 MB, modified time later than 02 Jun 2006 14:54:56 GMT, and access time later than 14 Aug 2012 13:37:08 GMT. The output format would contain the file name, modified time , file size and access time information from the specified subclient in the latest cycle.
Windows
- Create a pattern file with content as:
*\**\*.exe
Pattern file can contain patterns based on the wild card support. See Wildcards for detailed information.
- Run the command given below.
Unix
- Create a pattern file with content as:
/fsdm/**/*.exe
Pattern file can contain patterns based on the wild card support. See Wildcards for detailed information.
- Run the command given below.
Output for Windows and Unix
Examples of Job ID Based Commands
The following sections include examples of job id based commands using the getbackuplist command.
All Files Backed Up by a Job ID
You can use the following examples to get a complete list of files that were backed up during the specified job.
Windows
Unix
Output for Windows and Unix
All Files Backed Up by a Job ID with the Times Specified in Unix Timestamp
You can use the following examples to get a list of all files that were backed up at a time displayed in Unix Timestamp format, during the specified job.
Windows
Unix
Output for Windows and Unix
Files with Modified Time Later than 02/02/11 @ 11:43:05am
You can use the following examples to get a list of files with a modified time later than 02/02/11 at 11:43:05 a.m.
Windows
Unix
Output for Windows and Unix
Files with Modified Time Later than 02/02/11 @ 11:43:05am and Output Displaying Only File Size and File Name
You can use the following examples to get a list of files with a modified time that is later than 02/02/11 at 11:34:05 a.m. and display only the file size and the file name in the output.
Windows
Unix
Output for Windows and Unix
Files with Modified Time Later Than 02/02/11 @ 11:43:05am and File Size Greater Than 444 Bytes
You can use the following examples to get a list of files with a modified time that is later than 02/02/11 at 11:43:05 a.m. and a file size that is greater than 444 bytes.
Windows
Unix
Output for Windows and Unix
Files with Modified Time Later Than 02/02/11 @ 11:43:05am, File Size Greater Than 444 bytes, and with a File Name that Fits the Specified Pattern
You can use the following examples to get a list of files with a modified time that is later than 02/02/11 at 11:43:05 a.m., a file size greater than 444 bytes, and that conform to the naming pattern specified in a pattern file.
Windows
- Create a text file that contains a file name pattern, such as:
*\**\*.exe
The pattern file can contain patterns based on the wild card support. For detailed information on wildcard support, see Wildcards.
- Run the command given below.
Unix
- Create a pattern file with content as:
/fsdm/**/*.exe
Pattern file can contain patterns based on the wild card support. See Wildcards for detailed information.
- Run the command given below.
Output for Windows and Unix
Group or Owner Name
You can use the following examples to get a list of files with the group or owner name for each file in the job displayed in the output.
Windows
Unix
Sample Output for Windows and Unix
Output
The following example displays the output format for files with access time before April 1st 2012 and file size greater than 10 MB:
"\\E:\\FileGT5MB\\out.txt",1343146128,3786
"\\E:\\FileGT5MB\\sleep.exe",1327257030,135680
Output | Description of output values |
\\E:\\FileGT5MB\\ | Path in which the required file is present. |
out.txt | Name of the file |
1343146128 | Access time of the file in Unix time format. |
3786 | Size of the file in bytes. |