Command line interface

Change your password

Protect> set password
Please enter password for user id "DEMO": (1)

Please enter a new password: (2)
Enter new password for verification: (3)
Password updated.

Session established with server CCTSM9: Linux/x86_64
  Server Version 8, Release 1, Level 13.000
  Server date/time: 01/19/2023 19:43:14  Last access: 01/19/2023 11:56:15

Here you must:

  • Enter the initial password you received from the CC-IN2P3 TSM admins;

  • enter your new password;

  • enter your new password once again.

Check the management classes available

Protect> query mgmt -detail

Check the options enabled

Protect> query options
[...]

              ACTIVATEKEY: YES
          AFSBACKUPMNTPNT: YES
          ALLOWWILDCARDCH: NO
                   ARCHMC:
        ARCHSYMLINKASFILE: YES
               ASNODENAME:
             ASRFILESPATH:
                  ASRMODE: NO
             AUTOFSRENAME: PROMPT
             AUDITLOGGING: OFF
             AUDITLOGNAME: /tmp/dsmaudit.log
                AUTOMOUNT:
               AUTODEPLOY: YES
                   BACKMC:
           BACKUPREGISTRY: YES
       CANDIDATESINTERVAL: 1
       CASESENSITIVEAWARE: NO
          CHANGINGRETRIES: 4
          CHECKFORORPHANS: NO
          CHECKTHRESHOLDS: 5
               CLIENTVIEW: STANDARD
         CLUSTERDISKSONLY: NO
              CLUSTERNODE: NO
               COMMMETHOD: TCP/IP
      COLLOCATEBYFILESPEC: NO
      COMMRESTARTDURATION: 60
[...]
                   DOMAIN:
                           /home
                           /etc
[...]
        VIRTUALMOUNTPOINT:
                           /home
                           /etc

Note

For more information on the directives VirtualMountPoint or Domain, please refer to the FAQ.

Check the list of inclusion/exclusion filters

Protect> query inclexcl
[...]

*** FILE INCLUDE/EXCLUDE ***
Mode Function  Pattern (match from top down)  Source File
---- --------- ------------------------------ -----------------
No exclude filespace statements defined.
Excl Directory /.../*no_backup*               Server
Excl Directory /.../*NO_BACKUP*               Server
Excl Directory /.../.beagle                   Server
Excl Directory /.../.[Cc]ache                 Server
Excl Directory /.../[Cc]ache.Trash            Server
Excl Directory /.../Cache                     Server
Excl Directory /usr/lib64                     Server
Excl Directory /usr/lib32                     Server
Excl Directory /usr/lib                       Server
Excl Directory /usr/bin                       Server
Excl Directory /var/lock                      Server
Excl Directory /var/run                       Server
Excl Directory /var/tmp                       Server
Excl Directory /boot                          Server
Excl Directory /lib64                         Server
Excl Directory /lib32                         Server
Excl Directory /lib                           Server
Excl Directory /sbin                          Server
Excl Directory /bin                           Server
[...]

For example, the following line means that everything under /bin will not be saved:

Excl Directory /bin                           Server

The information Server indicates that this filter originates from the backup server (and is therefore not modifiable without intervention from the CC-IN2P3 TSM administrators).

Check the FileSpaces assigned to my backup node

Protect> query files

Backup a directory

% dsmc incremental /<path>/ -subdir=yes

Backup a file

% dsmc incremental /<path>/<my file>

Preview a directory contents as will be backed up

% dsmc preview backup /<path>/ -subdir=yes
[...]

Preview function invoked.
Depending on the number of objects to query, this operation could take a while to complete.

Are you sure you want to continue? (Yes (Y)/No (N)) Y
Preview output has been successfully written to file '/var/spool/tsm/log/dsmprev.txt'.

This command generates a list of files and directories in $PWD/dsmprev.txt, and mentions whether Storage Protect will save them or not. The preview file dsmprev.txt may in some cases be requested by CC-IN2P3 administrators to help you solve your backup problems.

Check the backed up files and their state

In Storage Protect a file may assume two states:

  • A pour Active when the file is still available on the machine that performs the backup;

  • I pour Inactive when the file is not longer available on the machine that performs the backup or is no longer the latest version of the file:

% dsmc query backup /var/spool/tsm/etc/dsm.sys -inactive
[...]

           Size        Backup Date                Mgmt Class           A/I File
           ----        -----------                ----------           --- ----
         2 206  B  20/09/2011 17:10:36              PCMGM               A  /var/spool/tsm/etc/dsm.sys
         1 929  B  01/06/2011 17:06:08              PCMGM               I  /var/spool/tsm/etc/dsm.sys
         2 010  B  18/07/2011 17:52:02              PCMGM               I  /var/spool/tsm/etc/dsm.sys
         2 178  B  19/07/2011 17:13:58              PCMGM               I  /var/spool/tsm/etc/dsm.sys

Restore the last version of a file

% dsmc restore /var/spool/tsm/etc/dsm.sys /tmp/dsm.sys.restored
[...]

Restore function invoked.

 ** Interrupted **
Restoring           2 206 /var/spool/tsm/etc/dsm.sys --> /tmp/dsm.sys.restored [Done]

Restore processing finished.

Total number of objects restored:         1
Total number of objects failed:           0
Total number of bytes transferred:    2,17 KB
Data transfer time:                    0,00 sec
Network data transfer rate:        90 779,62 KB/sec
Aggregate data transfer rate:          0,02 KB/sec
Elapsed processing time:           00:01:37

This command restores the last version of the file /var/spool/tsm/etc/dsm.sys to the location /tmp/dsm.sys.restored. If a new location would have not been specified, the file would have been restored directly in /var/spool/tsm/etc/dsm.sys and would have overwritten our file in case it already existed.

Restore the last version of a directory and its contents

% dsmc restore /var/spool/tsm/ -verbose -subdir=yes

As for files, you may specify a new location for the restore:

% dsmc restore /var/spool/tsm/ /tmp/tsm.restored/ -subdir=yes

Restore an older file version using a date

% dsmc query backup /var/spool/tsm/etc/dsm.sys -inactive -pitd=09/01/2011
[...]

           Size        Backup Date                Mgmt Class           A/I File
           ----        -----------                ----------           --- ----
         2,178  B  07/19/2011 17:13:58              PCMGM               I  /var/spool/tsm/etc/dsm.sys

The option -pitd means Point In Time Date and allows to specify a precise date for the restoration. In the command shown as an example we asked which version of file /var/spool/tsm/etc/dsm.sys was in Storage Protect as of September 1st 2011. The date format as specified in the option -pitd is MM/DD/YYYY (default format if LANG=C).

We can see that the file /var/spool/tsm/etc/dsm.sys from September 1st 2011 is an inactive version of the file backed up on July 19th 2011 and never modified since then. To restore it, just use the -pitd option in conjunction with the dsmc restore function:

% dsmc restore /var/spool/tsm/etc/dsm.sys -inactive -pitd=09/01/2011

Restore data between two dates

% dsmc restore /path/to/restore/ -fromdate=06/01/2014 -todate=06/11/2014 -subdir=yes

Restore a list of files

Given a file to_restore.txt with the following content:

/tmp/file1.txt
/tmp/file2.txt
[...]
/var/tmp/files/fileN.txt

To restore all the files listed in to_restore.txt, use the -filelist option of the Storage Protect client:

% dsmc restore -filelist=to_restore.txt
[...]

Get a report on installation and configuration

% dsmc query systeminfo
[...]

QUERY SYSTEMINFO output has been written to file /var/spool/tsm/etc/CCAFS/dsminfo.txt.

The file dsminfo.txt generated by this command may in some cases be requested by CC-IN2P3 administrators to help you solve your backup problems.