Loading...

File Level Analytics - Command Line - CSV (Indexing Version 1)

Table of Contents

Running File Level Analytics

Available Command Parameters

Examples of Client Name and Subclient Name Based Commands

Examples of Job ID Based Commands

Output

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.

Note: File Level Analytics - Command Line - CSV works for Indexing Version 1 only.

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

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

  2. Run one of the following commands.

    Subclient Based Command:

    getbackuplist -client <client name> -apptype <apptype name> -instance <instance name> -backupset <backupset name> -subclient <subclient name> -outfile <file name> -ma MediaAgent -where <where clause> -format <format string> -patternfile <file name> -vm <Instance> -dbjob -unixtime -commcell <commcell name>

    Job ID Based Command:

    getbackuplist -jobid <job id> -outfile <file name> -where <where clause> -format <format string> -patternfile <file name> -vm <Instance> -dbjob -unixtime -commcell <commcell name>

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

getbackupList -apptype "File System" -client client1 -subclient sc1 -outfile c:\out1.txt

Notes

  1. If no backupset is provided, the default backupset is considered.
  2. If there are two subclients with the same name on the client, then you must specify a backupset.
  3. If you run a query on a virtual machine, then you must specify the instance name with the -vm parameter.
  4. 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.
  5. If unixtime stamp is not specified, human readable time will be printed in the output.
  6. 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.

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

getbackuplist -Jobid <jobid> -outfile <location of output file>

Help

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

  2. Run the following command:

    getbackuplist -help

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.

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

 

file_size

Size of files in backup presented in Bytes.

mod_time

The time at which the file was modified. This time needs to be in unix time format. Use any third party converting tool to convert windows time to unix time.

access_time

The time at which the file was last accessed. This time needs to be in unix time format. Use any third party converting tool to convert windows time to unix time.

basename

File name (without the full path) of the file for which file level information is retrieved.

 

The following operators can be used:

  • AND - can be used when more than two arguments are used in the where clause.
  • <
  • >
  • ==

-format

 

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

Note: If using MS SQL, see GetSQLJobList.

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

GetbackupList.exe -client <client name> -apptype "File System" -subclient <subclient name> -outfile c:\output\Outfile.txt

Unix

./getbackupList -client <client name> -apptype "File System" -subclient <subclient name> -outfile /tmp/out.txt

Output for Windows and Unix

"/subclient_fs/file1.Z",7221568,"Wed Oct 24 14:49:26 2012""/subclient_fs/file1.cpio",101101952,"Wed Oct 24 14:49:27 2012""/subclient_fs/file1.doc",1757,"Wed Oct 24 14:49:27 2012""/subclient_fs/file1.exe",880,"Wed Oct 24 14:49:27 2012""/subclient_fs/file1.html",14443136,"Wed Oct 24 14:49:27 2012"

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

GetbackupList.exe -client <client name> -apptype "File System" -subclient <subclient name> -outfile c:\output\Outfile.txt -format "basename,mod_time,access_time,file_size"

Unix

./getbackupList -client <client name> -apptype "File System" -subclient <subclient name> -outfile /tmp/out.txt -format "basename,mod_time,access_time,file_size"

Output for Windows and Unix

"file1.Z","Wed Oct 24 14:49:26 2012","Mon Oct 29 18:35:05 2012",7221568"file1.cpio","Wed Oct 24 14:49:27 2012","Tue Oct 30 06:08:52 2012",101101952"file1.doc","Wed Oct 24 14:49:27 2012","Thu Oct 25 12:17:38 2012",1757"file1.exe","Wed Oct 24 14:49:27 2012","Wed Oct 24 18:44:26 2012",880"file1.html","Wed Oct 24 14:49:27 2012","Fri Oct 26 09:22:07 2012",14443136

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

GetbackupList.exe -client <client name> -apptype "File System" -subclient <subclient name> -outfile c:\output\Outfile.txt -format "basename,mod_time,access_time,file_size" -ma ma.companyname.com

Unix

./getbackupList -client <client name> -apptype "File System" -subclient <subclient name> -outfile /tmp/out.txt -format "basename,mod_time,access_time,file_size" -ma ma.companyname.com

Output for Windows and Unix

"file1.Z","Wed Oct 24 14:49:26 2012","Mon Oct 29 18:35:05 2012",7221568"file1.cpio","Wed Oct 24 14:49:27 2012","Tue Oct 30 06:08:52 2012",101101952"file1.doc","Wed Oct 24 14:49:27 2012","Thu Oct 25 12:17:38 2012",1757"file1.exe","Wed Oct 24 14:49:27 2012","Wed Oct 24 18:44:26 2012",880"file1.html","Wed Oct 24 14:49:27 2012","Fri Oct 26 09:22:07 2012",14443136

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

GetbackupList.exe -client <client name> -apptype "File System" -subclient <subclient name> -outfile c:\output\Outfile.txt -format "basename,mod_time,access_time,file_size" –unixtime

Unix

./getbackupList -client <client name> -apptype "File System" -subclient <subclient name> -outfile /tmp/out.txt -format "basename,mod_time,access_time,file_size" –unixtime

Output for Windows and Unix

"file1.Z",1351104566,1348943705,7221568"file1.cpio",1351104567,1348985332,101101952"file1.doc",1351104567,1348575458,1757"file1.exe",1351104567,1348512266,880"file1.html",1351104567,1348651327,14443136

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

GetbackupList.exe -client <client name> -apptype "File System" -subclient <subclient name> -outfile c:\output\Outfile.txt -format "basename,mod_time,file_size" -where "file_size > 10240000"

Unix

./getbackupList -client <client name> -apptype "File System" -subclient <subclient name> -outfile /tmp/out.txt -format "basename,mod_time,file_size" -where "file_size > 10240000"

Output for Windows and Unix

"file1.cpio","Wed Oct 24 14:49:27 2012",101101952"file1.html","Wed Oct 24 14:49:27 2012",14443136"file1.ini","Wed Oct 24 14:49:28 2012",14443136"file1.mp3","Wed Oct 24 14:49:28 2012",14443136"file1.sys","Wed Oct 24 14:49:40 2012",1011019520

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

GetbackupList.exe -client <client name> -apptype "File System" -subclient <subclient name> -outfile c:\output\Outfile.txt -format "basename,mod_time,file_size,access_time" -where "file_size > 10240000 and mod_time > 1149260096 and access_time > 1344951428"

Unix

./getbackupList -client <client name> -apptype "File System" -subclient <subclient name> -outfile /tmp/out.txt -format "basename,mod_time,file_size,access_time" -where "file_size > 10240000 and mod_time > 1149260096 and access_time > 1344951428"

Output for Windows and Unix

"file0.cpio","Tue Nov 13 15:28:05 2012",101101952,"Tue Dec 18 14:18:44 2012""file0.html","Tue Nov 13 15:28:06 2012",14443136,"Tue Dec 18 14:18:49 2012""file0.ini","Tue Oct 30 08:00:00 2012",14443136,"Tue Dec 18 14:18:50 2012""file0.mp3","Tue Nov 13 15:28:07 2012",14443136,"Tue Dec 18 14:18:51 2012""file0.sys","Tue Nov 13 15:28:20 2012",1011019520,"Tue Dec 18 14:21:54 2012"

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

  1. Create a pattern file with content as:

    *\**\*.exe

    Pattern file can contain patterns based on the wild card support. See Wildcards for detailed information.

  2. Run the command given below.

GetbackupList.exe -client <client name> -apptype "File System" -subclient <subclient name> -outfile c:\output\Outfile.txt -format"basename,mod_time,file_size,access_time" -where "file_size > 10240000 and mod_time > 1149260096 and access_time > 1344951428" -patternfile c:\xxxx.txt

Unix

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

  2. Run the command given below.

 

./getbackupList -client <client name> -apptype "File System" -subclient <subclient name> -outfile /tmp/out.txt -format"basename,mod_time,file_size,access_time" -where "file_size > 10240000 and mod_time > 1149260096 and access_time > 1344951428" -patternfile /tmp/xxxx.txt

Output for Windows and Unix

"/default_fs/file1.exe",880,"Wed Oct 24 14:49:27 2012""/default_fs/file2.exe",14443136,"Wed Oct 24 14:49:27 2012""/default_fs/file3.exe",14443136,"Wed Oct 24 14:49:28 2012""/default_fs/file6.exe",880,"Wed Oct 24 14:49:28 2012""/default_fs/file8.exe",14443136,"Wed Oct 24 14:49:28 2012"

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

GetbackupList.exe -jobid 117453 -outfile c:\output\Outfile.txt

Unix

./getbackupList -jobid 117453 -outfile /tmp/out.txt

Output for Windows and Unix

"/subclient_fs/file1.Z",7221568,"Wed Oct 24 14:49:26 2012""/subclient_fs/file1.cpio",101101952,"Wed Oct 24 14:49:27 2012""/subclient_fs/file1.doc",1757,"Wed Oct 24 14:49:27 2012""/subclient_fs/file1.exe",880,"Wed Oct 24 14:49:27 2012""/subclient_fs/file1.html",14443136,"Wed Oct 24 14:49:27 2012"

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

GetbackupList.exe -jobid 117453 -outfile c:\output\Outfile.txt -unixtime

Unix

./getbackupList -jobid 117453 -outfile /tmp/out.txt -unixtime

Output for Windows and Unix

"/subclient_fs/file1.Z",7221568,1351104566"/subclient_fs/file1.cpio",101101952,1351104567"/subclient_fs/file1.doc",1757,1351104567"/subclient_fs/file1.exe",880,1351104567"/subclient_fs/file1.html",14443136,1351104567

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

GetbackupList.exe -jobid 117453 -outfile c:\output\Outfile.txt -where "mod_time > 1296668585"

Unix

./getbackupList -jobid 117453 -outfile /tmp/out.txt -where "mod_time > 1296668585"

Output for Windows and Unix

"/subclient_fs/file1.Z",7221568,"Wed Oct 24 14:49:26 2012""/subclient_fs/file1.cpio",101101952,"Wed Oct 24 14:49:27 2012""/subclient_fs/file1.doc",1757,"Wed Oct 24 14:49:27 2012""/subclient_fs/file1.exe",880,"Wed Oct 24 14:49:27 2012""/subclient_fs/file1.html",14443136,"Wed Oct 24 14:49:27 2012"

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

GetbackupList.exe -jobid 117453 -outfile c:\output\Outfile.txt -where "mod_time > 1296668585" -format "file_size,basename"

Unix

./getbackupList -jobid 117453 -outfile /tmp/out.txt -where "mod_time > 1296668585" -format "file_size,basename"

Output for Windows and Unix

7221568,"file1.Z"101101952,"file1.cpio"1757,"file1.doc"880,"file1.exe"14443136,"file1.html"

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

GetbackupList.exe -jobid 117453 -outfile c:\output\Outfile.txt -where "mod_time > 1296668585 and file_size > 444" -format "file_size,basename,full_file_name"

Unix

./getbackupList -jobid 117453 -outfile /tmp/out.txt -where "mod_time > 1296668585 and file_size > 444" -format "file_size,basename,full_file_name"

Output for Windows and Unix

7221568,"file1.Z","/subclient_fs/file1.Z"101101952,"file1.cpio","/subclient_fs/file1.cpio"1757,"file1.doc","/subclient_fs/file1.doc"880,"file1.exe","/subclient_fs/file1.exe"14443136,"file1.html","/subclient_fs/file1.html"

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

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

  2. Run the command given below.

GetbackupList.exe -jobid 117453 -outfile c:\output\Outfile.txt -where "mod_time > 1296668585 and file_size > 444" -format "file_size,basename,full_file_name,mod_time" -unixtime -patternfile c:\xxxx.txt

Unix

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

  2. Run the command given below.

./getbackupList -jobid 117453 -outfile /tmp/out.txt -where "mod_time > 1296668585 and file_size > 444" -format "file_size,basename,full_file_name,mod_time" -unixtime -patternfile /tmp/xxxx.txt

Output for Windows and Unix

21714,"file0.exe","/fsdm/file0.exe",135272520021714,"file1.exe","/fsdm/file1.exe",135272520028974,"file10.exe","/fsdm/file10.exe",13527252005280,"file11.exe","/fsdm/file11.exe",135272520019338,"file12.exe","/fsdm/file12.exe",1352725200

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

GetbackupList.exe -jobid 117453 -outfile c:\output\Outfile.txt -format "basename,group,owner" where group = "group name" and owner="owner name"

Unix

./getbackupList -jobid 117453 -outfile /tmp/out.txt -format "basename,group,owner" where group = "group name" and owner="owner name"

Sample Output for Windows and Unix

"121112120900","group1","user1""201211120800","group1","user1""201211130800","group1","user1""file0.tar","group1","user1""file1.tar","group1","user1"

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.

Last modified: 9/28/2018 3:32:49 PM