4. Querying the server

The following query commands illustrate typical command syntax and output.

4.1. Querying your scheduled backup slot

To query your scheduled backup slot enter q sched (which is short for query schedule). The output should look similar to that below:

tsm> q sched

    Schedule Name: WEEKLY_ITSERV
      Description: ITSERV weekly incremental backup
   Schedule Style: Classic
           Action: Incremental
          Options: 
          Objects: 
         Priority: 5
   Next Execution: 149 Hours and 35 Minutes
         Duration: 15 Minutes
           Period: 1 Week  
      Day of Week: Wednesday
            Month:
     Day of Month:
    Week of Month:
           Expire: Never
  

4.2. Querying what files are included / excluded for backup

At the tsm> prompt enter q inclexcl to list output similar to the following:

tsm> q inclexcl
*** FILE INCLUDE/EXCLUDE ***
Mode Function  Pattern (match from top down)  Source File
---- --------- ------------------------------ -----------------
Excl Filespace /var/run                       /opt/tivoli/tsm/client/ba/bin/incl.excl
Excl Filespace /tmp                           /opt/tivoli/tsm/client/ba/bin/incl.excl
Excl Directory /.../.opera/.../cache4         /opt/tivoli/tsm/client/ba/bin/incl.excl
Excl Directory /.../.mozilla/.../Cache        /opt/tivoli/tsm/client/ba/bin/incl.excl
Excl Directory /.../.netscape/.../cache       /opt/tivoli/tsm/client/ba/bin/incl.excl
Excl Directory /var/tmp                       /opt/tivoli/tsm/client/ba/bin/incl.excl
Excl All       /.../dsmsched.log              /opt/tivoli/tsm/client/ba/bin/incl.excl
Excl All       /.../core                      /opt/tivoli/tsm/client/ba/bin/incl.excl
Excl All       /.../a.out                     /opt/tivoli/tsm/client/ba/bin/incl.excl
No DFS include/exclude statements defined.
  

Note that the include / exclude directives are listed at the partition level first, then the directory / folder level and finally at the file level. The order they are displayed above is the order in which these directives are applied by TSM. You will note that the order of the directives at any one level is the opposite of the order in which they appear in the options file. That is, TSM reads the directives listed in options file from the bottom up.

4.3. Querying what partitions have been backed up

At the tsm> prompt enter q fi to list which partitions have been backed up:


** Windows **

  #     Last Incr Date      Type    File Space Name
---     --------------      ----    ---------------
  1   01-05-2012 19:46:59   NTFS    \\tentacles.oucs\c$

** Mac **

tsm> q fi
  #     Last Incr Date      Type    File Space Name
---     --------------      ----    ---------------
  1   02-05-2012 02:13:13   HFS     /           
  2   25-07-2011 12:26:09   HFS     /Volumes/Disk 2

** Linux  **

tsm> q fi
#       Last Incr Date      Type    File Space Name
---     --------------      ----    ---------------
  1   02-05-2013 02:13:13   EXT4    /           
  2   25-07-2014 12:26:09   EXT3    /home

** Solaris  **

tsm> q fi
#       Last Incr Date      Type    File Space Name
---     --------------      ----    ---------------
  1   02-05-2012 02:13:13   UFS     /           
  2   25-07-2011 12:26:09   UFS     /export/home
    

** Netware **

  #     Last Incr Date      Type       File Space Name
---     --------------      ----       ---------------
  1   02-05-2012 00:23:46   NTW:LONG   NSMS1\SYS:
  2   02-05-2012 00:22:42   NDS        NSMS1\NDS: 
  3   02-05-2012 00:25:33   NTW:LONG   NSMS1\USR:
  4   02-05-2012 00:25:11   NTW:LONG   NSMS1\APPS:
  

4.4. Querying what files have been backed up

The syntax for querying what files you have backed up involves giving a file specification which is necessarily OS specific. Also, if an incorrect file specification is given it may appear that you have no backups. Consequently, several worked examples are displayed below for Windows, Mac, Linux/Unix and Netware environments.

If you give just a path to a directory / folder you will only get the folder returned as the output:

** Windows ** 

tsm> q ba c:\Downloads
   Size      Backup Date                Mgmt Class           A/I File
   ----      -----------                ----------           --- ----
     0  B  03-04-2012 19:57:54          STANDARD             A  \\tentacles.oucs\c$\Downloads

** Mac **

tsm> q ba /Users
   Size      Backup Date                Mgmt Class           A/I File
   ----      -----------                ----------           --- ----
    72  B  24-04-2012 02:52:09          STANDARD             A  /Users

** Linux/Unix **

tsm> q ba /home/ians/projects
   Size      Backup Date                Mgmt Class           A/I File
   ----      -----------                ----------           --- ----
   512  B  24-04-2012 02:52:09          STANDARD             A  /home/ians/projects

** Netware **

tsm> q ba USR:/ians
   Size      Backup Date                Mgmt Class           A/I File
   ----      -----------                ----------           --- ----
     0  B  02-05-2012 00:25:32          STANDARD             A  USR:/ians
  

Note that the Windows client lists the directory in UNC format. This format can also be used for the file specification in the query.

If you just add a trailing * (star) as a wildcard in the above query, TSM will only return those files and directories backed up immediately below the directory path given in the query

 
tsm>q ba /home/ians/projects/*
   Size      Backup Date        Mgmt Class A/I File
   ----      -----------        ---------- --- ----
    512  12-09-2011 19:57:09    STANDARD    A  /home/ians/projects/hfs0106
  1,024  08-12-2011 02:46:53    STANDARD    A  /home/ians/projects/hsm41perf
    512  12-09-2011 19:57:09    STANDARD    A  /home/ians/projects/hsm41test
    512  24-04-2012 00:22:56    STANDARD    A  /home/ians/projects/hsm42upg
  

If you want to query all the current files and directories backed up under a directory and all its subdirectories you need to add the -subdir=yes option as below:

tsm> q ba /home/ians/projects/* -subdir=yes
   Size      Backup Date        Mgmt Class A/I File
   ----      -----------        ---------- --- ----
    512  12-09-2011 19:57:09    STANDARD    A  /home/ians/projects/hfs0106
  1,024  08-12-2011 02:46:53    STANDARD    A  /home/ians/projects/hsm41perf
    512  12-09-2011 19:57:09    STANDARD    A  /home/ians/projects/hsm41test
    512  24-04-2012 00:22:56    STANDARD    A  /home/ians/projects/hsm42upg
  1,024  12-09-2011 19:57:09    STANDARD    A  /home/ians/projects/hfs0106/test
  1,024  12-09-2011 19:57:09    STANDARD    A  /home/ians/projects/hfs0106/test/test2
 12,048  04-12-2011 02:01:29    STANDARD    A  /home/ians/projects/hsm41perf/tables
 50,326  30-04-2012 01:35:26    STANDARD    A  /home/ians/projects/hsm42upg/PMR70023
 50,326  27-04-2012 00:28:15    STANDARD    A  /home/ians/projects/hsm42upg/PMR70099
 11,013  24-04-2012 00:22:56    STANDARD    A  /home/ians/projects/hsm42upg/md5check
  

Note that file specifications with spaces in them will need to be quoted. Thus to query all the files backed up under C:\My Documents and any sub-directories below it, the following input would be required:

 
tsm> q ba "C:\My Documents\*" -subdir=yes
  

By default only the current versions of files are listed. In order to query both current active and previous inactive versions of files, add the -inactive option to the query:

tsm> q ba /home/ians/projects/* -subdir=yes -inactive
   Size      Backup Date        Mgmt Class A/I File
   ----      -----------        ---------- --- ----
    512  12-09-2011 19:57:09    STANDARD    A  /home/ians/projects/hfs0106
  1,024  08-12-2011 02:46:53    STANDARD    A  /home/ians/projects/hsm41perf
    512  12-09-2011 19:57:09    STANDARD    A  /home/ians/projects/hsm41test
    512  24-04-2012 00:22:56    STANDARD    A  /home/ians/projects/hsm42upg
  1,024  12-09-2011 19:57:09    STANDARD    A  /home/ians/projects/hfs0106/test
  1,024  12-09-2011 19:57:09    STANDARD    A  /home/ians/projects/hfs0106/test/test2
 12,048  04-12-2011 02:01:29    STANDARD    A  /home/ians/projects/hsm41perf/tables
  8,448  03-12-2011 01:31:18    STANDARD    I  /home/ians/projects/hsm41perf/tables
 50,326  30-04-2012 01:35:26    STANDARD    A  /home/ians/projects/hsm42upg/PMR70023
 50,326  27-04-2012 00:28:15    STANDARD    A  /home/ians/projects/hsm42upg/PMR70099
 11,013  24-04-2012 00:22:56    STANDARD    A  /home/ians/projects/hsm42upg/md5check
 11,013  23-04-2012 17:10:08    STANDARD    I  /home/ians/projects/hsm42upg/md5check
  

Note how the previous versions of files are marked by an I (for Inactive) in the A/I column.

Unix and Linux users should be aware of potential confusion of how TSM stores files in nested file spaces. This can arise in the following situation: A user backs-up a file myconf.txt on the /usr partition in the /usr/local/etc directory. Subsequently, a new disk partition is mounted at /usr/local, or it is defined as a virtualmountpoint. Running the command:

  tsm> q ba /usr/local/etc/*

will not list the myconf.txt file. This is because TSM always looks for a file in the filespace (partition) with the longest name that matches the file specification you include in the command. In the above example, the file was not backed up under the /usr/local filespace but under the /usr filespace. To tell TSM to look for a file in latter filespace you must specify the filespace explicitly using braces, as below:

  tsm> q ba {/usr}/local/etc/*

Up: Contents Previous: 3. Accessing Help Next: 5. Backing up your data