Query Backup

The query backup command displays a list of backup versions of your files that are stored on the IBM Spectrum® Protect server, or that are inside a backup set from the server when the backupsetname option is specified.

The command displays the following file information:
  • File specification
  • File size
  • Backup date
  • Whether the file is active or inactive
  • The management class that is assigned to the file. Only the first 10 characters of the management class name are displayed.
If you use the detail option with the query backup command, the client displays the following extra information:
  • Last modification date
  • Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsLast access date
  • Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsLast file attributes (inode) change date
  • Windows operating systemsCreation date
  • Compression type
  • Encryption type
  • Client-side data deduplication
  • Linux operating systemsAIX operating systemsWhether the file is migrated or premigrated. A value of Yes means that the file is migrated or premigrated. A value of No means that the file is not migrated or premigrated.
  • Linux operating systemsAIX operating systemsFile inode number
  • Linux operating systemsAIX operating systemsSize of ACL metadata (IBM Spectrum Scale)
  • Linux operating systemsAIX operating systemsServer storage information (media class, volume ID, and restore order)

The following example shows sample output when the query backup command is issued with the detail option:

Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systems
      Size        Backup Date                Mgmt Class           A/I File
      ----        -----------                ----------           --- ----
1,500,000  B  08/15/2016 16:01:25             DEFAULT              A  /home/test/mydir/myfile1.txt
    Modified: 08/15/2016 16:00:10 Accessed: 08/16/2016 15:31:23 Inode changed: 08/15/2016 16:00:10
Compression Type: LZ4  Encryption Type: None  Client-deduplicated: YES  Migrated: NO  Inode#: 22691
ACL Size: 0  Media Class: Fixed  Volume ID: 0008 Restore Order: 00000000-0000001F-00000000-00600774
Windows operating systems
      Size        Backup Date                Mgmt Class        A/I File
      ----        -----------                ----------        --- ----
1,000,000  B  03/15/2016 14:33:17             DEFAULT           A  \\eighth\n$\testdir\myfile1.txt
    Modified: 03/15/2016 14:31:42        Created: 03/15/2016 14:31:41
Compression Type: LZ4  Encryption Type: None    Client-deduplicated: YES

For more information about the compression type, see Compression.

Supported Clients

This command is valid for all clients.

Syntax

Read syntax diagramSkip visual syntax diagramQuery Backup options filespec {filespacename}filespec filespec "filespec"

Parameters

Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsfilespec
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsSpecifies the path and file name that you want to query. Use wildcard characters to specify a group of files or all the files in a directory. If you use wildcard characters, enclose the file specification in double quotation marks. Specify an asterisk (*) to display information about backup versions for all of your files in the current directory. Do not use wildcards characters when you query NAS file system images with -class=nas option setting.
Windows operating systemsfilespec
Windows operating systemsSpecifies the path and file name that you want to query. Use wildcard characters to specify a group of files or all the files in a directory. Do not use wildcard characters when you query NAS file system images with -class=nas option setting.

If you include filespacename, do not include a drive letter in the file specification. Drive label names are only used for removable media.

You can also use the following value for filespec:

systemstate
Displays the list of backup versions of Windows system state.
Windows operating systems{filespacename}
Windows operating systemsSpecifies the file space, enclosed in braces, on the server that contains the file you want to query. This is the drive label or UNC name on the workstation drive from which the file was backed up. The following example shows how to specify a UNC name: {'\\machine\C$'}.

Use the filespacename if the name has changed, or if you want to query files backed up from another node with drive label names that are different from yours.

You must specify a mixed or lowercase NTFS or ReFS file space name that is enclosed in quotation marks and braces. For example, {"NTFSDrive"}. Single quotation marks or double quotation marks are valid in loop mode. For example: {"NTFSDrive"} and {'NTFSDrive'} are both valid. In batch mode, only single quotation marks are valid.

Table 1. Query Backup command: Related options
Option Where to use
backupsetname Command line only.
Mac OS X operating systemsWindows operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsclass Mac OS X operating systemsWindows operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsCommand line only.
Windows operating systemsdateformat Windows operating systemsClient options file (dsm.opt) or command line.
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsdateformat Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsClient system options file (dsm.sys) or command line.
detail Command line only.
dirsonly Command line only.
filelist Command line only.
filesonly Command line only.
fromdate Command line only.
fromowner Command line only.
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsfromowner Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsCommand line only.
fromtime Command line only.
inactive Command line only.
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsnasnodename Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsClient system options file (dsm.sys) or command line.
Windows operating systemsnasnodename Windows operating systemsClient options file (dsm.opt) or command line.
Windows operating systemsnumberformat Windows operating systemsClient options file (dsm.opt) or command line.
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsnumberformat Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsClient user-options file (dsm.opt) or command line.
pitdate Command line only.
pittime Command line only.
querysummary Command line only.
Windows operating systemsscrolllines Windows operating systemsClient options file (dsm.opt) or command line.
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsscrolllines Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsClient user-options file (dsm.opt) or command line.
Windows operating systemsscrollprompt Windows operating systemsClient options file (dsm.opt) or command line.
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsscrollprompt Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsClient user-options file (dsm.opt) or command line.
Windows operating systemssubdir Windows operating systemsClient options file (dsm.opt) or command line.
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemssubdir Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsClient user-options file (dsm.opt) or command line.
Windows operating systemstimeformat Windows operating systemsClient options file (dsm.opt) or command line.
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemstimeformat Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsClient user-options file (dsm.opt) or command line.
todate Command line only.
totime Command line only.

Examples

Windows operating systemsdsmc query backup c:\* -subdir=yes -querysummary

Windows operating systemsdsmc query archive c:\* -subdir=yes -querysummary

Windows operating systemsTask
Windows operating systemsQuery files from the abc file space proj directory.

dsmc query backup {"abc"}\proj\*.*

Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsTask
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsDisplay a list of all active and inactive backup versions of your files in the current directory.

dsmc query backup –inactive "*"

Windows operating systemsTask
Windows operating systemsDisplay a list of all active and inactive backup versions that were backed up from the c:\proj directory.

dsmc q backup –ina c:\proj\*

Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsTask
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsDisplay a list of all your backups in the current directory. Use the detail option to display the last modification date and the last access date of each file.

dsmc q backup -detail "*"

Windows operating systemsTask
Windows operating systemsDisplay a list of all your backups in the c:\dir1 directory. Use the detail option to display the last modification date and the creation date of each file.

dsmc q backup -detail c:\dir1\*

Windows operating systemsTask
Windows operating systemsDisplay a list of all active and inactive backup versions that were backed up from the c:\proj directory. Use the dateformat and timeformat options to reformat the dates and times.

dsmc q b –date=5 –time=4 –ina c:\proj\*

Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsTask
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsDisplay a list of files that were backed up from the /home/proj directory with file names that begin with proj.

dsmc q b "/home/proj/proj*"

Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsTask
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsDisplay a list of active and inactive backup file versions in the /home file system.

dsmc q b –ina –su=yes /home/

Windows operating systemsTask
Windows operating systemsLast week you backed up files from a diskette labeled docs. Display a list of those files.

dsmc q b {docs}\*

Oracle Solaris operating systemsLinux operating systemsAIX operating systemsTask
Oracle Solaris operating systemsLinux operating systemsAIX operating systemsQuery file system images from the nas2 NAS file server.

dsmc query backup -nasnodename=nas2 -class=nas

Windows operating systemsTask
Windows operating systemsQuery file system images from the nas2 NAS file server.

dsmc query backup -nasnodename=nas2 -class=nas

Windows operating systemsTask
Windows operating systemsDisplay a list of all files from your c drive that are contained in the backup set weekly_accounting_data.32145678.

dsmc query backup c:\* -subdir=yes -backupsetname=weekly_accounting_data.32145678

Windows operating systemsTask
Windows operating systemsDisplay information about all the active and inactive backup versions of the system state on the server.

dsmc query backup -ina systemstate