TSM allows you to backup and archive your local data.
Backup
Backup may be used to perform incremental backups of your system. This way you may recover files deleted by accident or a hardware failure.
A backup will only work on your computer.
Archive
Archives let you store files which you don't need at the moment or which only access irregularly. This way you may save local disk space. If you use an archive, you need to enter the password every time you want to access it.
Archives may be accessed by multiple computers and shared by a team.
Configuration
You can use TSM in three different ways. The configuration is different in each case.
- Use the backup
- Use the archive
- Use backup and archive together. You still need to two different nodes a archive and a backup node.
apt install tivsm-ba
If you use a different Linux distribution you can find installable packages → here.
At the moment the Unix backup servers are running version 8. You need to install the same version.
1. Create config files
TSM config files are stored in /opt/tivoli/tsm/client/ba/bin/.
To set up TSM, you need to create dsm.opt, dsm.sys and excludelist configuration files.
Create these files with these commands.
touch /opt/tivoli/tsm/client/ba/bin/dsm.opt
touch /opt/tivoli/tsm/client/ba/bin/dsm.sys
touch /opt/tivoli/tsm/client/ba/bin/excludelist
Now all files are created.
2. Change configuration files
Open /opt/tivoli/tsm/client/ba/bin/dsm.opt and enter:
DATEformat 4
Open /opt/tivoli/tsm/client/ba/bin/dsm.sys and enter:
SErvername tsm02 NODENAME your.node.name commmethod TCPip TCPPort 1500 TCPServeraddress tsm02.zdv.uni-mainz.de PASSWORDACCESS generate webports 1501 1581 managedservices schedule schedmode prompted ERRORlogname /var/log/adsmerror.log SCHEDLOGNAME /var/log/adsmsched.log schedlogret 5 Inclexcl /opt/tivoli/tsm/client/ba/bin/excludelist
You need to make a change in line two starting with NODENAME. Replace your.node.name with the nodename provided to you.
The file /opt/tivoli/tsm/client/ba/bin/excludelist holds information about files and folders excluded from backup.
To exclude a file use EXCLUDE path.to.file.
To exclude a folder and all it's content use EXCLUDE.DIR path.to.folder.
You may use /.../ for multiple paths.
This can be useful to exclude temporary files.
Here is an example to exclude all files named core and folder and sub folder of /tmp, /var/log, /var/run and /var/tmp.
EXCLUDE /.../core EXCLUDE.DIR /tmp EXCLUDE.DIR /var/log EXCLUDE.DIR /var/run EXCLUDE.DIR /var/tmp
❗ Attention: Encrypted folder
If you use virtual file systems like encfs or ecryptfs (e.g. used by Ubuntu to encrypt your home folder) to encrypt your data, TSM only backs up your encrypted files by default.
If you want to back up plain text files you need to add a virtual mount point, this will tell TSM to back up all data inside a folder, even though they are saved encrypted somewhere else.
To add a virtual mount point you need to add the following line in /opt/tivoli/tsm/client/ba/bin/dsm.sys.
virtualmountpoint "path to folder with unencrypted files"
3. Start and log in
To start TSM type dsmc inside your terminal.
You will be asked for your username and password. Your user id is your nodename and it should be seen inside < > brackets. If this is the case you can press Enter without typing it again. Use the password provided to you.
4. Autostart
To autostart TSM and enable automatic backups run update-rc.d dsmcad enable with root rights.
Restart your computer.
Tp make sure everything runs without a problem, type:
cat /var/log/dsmwebcl.log.
You should see time and date for the next backup.
5. configure firewall
To use automatic backups port 1501 needs to be open. On ZDV virtual servers you can open this port by using this command ufw allow TSM.
Create these files with these commands.
touch /opt/tivoli/tsm/client/ba/bin/dsm.opt
touch /opt/tivoli/tsm/client/ba/bin/dsm.sys
Open /opt/tivoli/tsm/client/ba/bin/dsm.opt with root rights and enter:
DATEformat 4
Open /opt/tivoli/tsm/client/ba/bin/dsm.sys with root rights and enter:
SErvername tsm02 NODENAME archive.name commmethod TCPip TCPPort 1500 TCPServeraddress tsm02.zdv.uni-mainz.de PASSWORDAccess prompt ERRORlogname /var/log/adsmerror.log SCHEDLOGNAME /var/log/adsmsched.log schedlogret 5
You need to make a change in line two starting with NODENAME. Replace archive.name with the archive name provided to you.
To access the archive you need to add "-virtualnodename=archive.name" after the dsmc command.
Change archive.name to the name of the archive you want to access.
To open the archives inside command line, type (change archive.name to the archive name you want to access):
dsmc -virtualnodename=archive.name
Usage
TSM can be used inside a terminal or with a graphical user interface (GUI).
The GUI interface is the same on all operating systems. For information about using the GUI, please refer to the Windows documentation → Documentation about backups and restore and documentation about archiving. You can start the GUI interface by typing dsmj inside your terminal.
This documentation explains how to use TSM using a terminal.
TSM can be used in two different ways.
- Inside an interactive shell, where you can enter all commands.
To open this shell, type dsmc inside your terminal. You will see a new line starting with tsm>. All commands can be entered there. - Directly from a terminal by entering the command when opening TSM.
To run a command from a terminal, type dsmc "followed by the command".
The next section explains commands used by TSM how you enter them is up to you.
Create initial backup
To create an initial backup of your system use the command backup. Backups will run automatically. There is no need to perform manual backups.
Restore files/folder
To restore a file/folder, use restore "path to file/folder". This will restore the selected file/folder to its original location.
In most cases you need to add additional options to your command if you want to restore files in a specific way. You may combine the different options to restore files/folder the way you want.
Restore files/folder to a different location
restore "path to file/folder" "path where to restore".
Restore deleted or older files
TSM differentiates between active and inactive files. All files of the last backup are treated as active files. Older or deleted files are treated as inactive files. By default, TSM only shows and restores active files.
To restore the latest backed up file no matter if it's active or not, use:
restore "path to file/folder" -inac=yes.
Restore sub folder
By default, TSM only restores the folder or file you have chosen. This means that if you choose a folder, no data in sub folders will be restored. To restore all data (including all data in sub folders), use:
restore "path to folder" -sub=yes.
Select the files/folder to restore
TSM can show you a interactive list of backed up files/folders. You can select which files/folders to restore. This may be helpful if you only want to restore a file from inside a folder and don't know how the file was named or if you want to restore an older backup of the file. To show you the list of files use:
restore "path to file/folder" -pick.
This option is most useful if combined with the -inac=yes and/or -sub=yes option.
Examples
- Restore a deleted file to a specific location.
restore "path to file" "path where to restore" -inac=yes - Select between all backed up versions of a file inside a folder and restore them at their original location.
restore "path to folder" -pick -inac=yes - Select between all versions of backed up files and folders inside a folder, including files in subfolders and restore them at a specific location.
restore "path to folder" "path to restore" -pick -sub=yes -inac=yes
Archive files and folders
To make it easier to find and restore archived data, it is best to provide a description when using the archive function. To do so, use -desc='Your Description'. ❗ Attention: Your description must be written between the ' ' symbols.
To archive a file type: archive -desc='description' "path to file".
To archive a folder type: archive -desc='description' "path to folder". ❗ Attention: By default TSM doesn't transfer the content of sub folders.
To archive a folder and sub folder type: archive -desc='description' -sub=yes "path to folder".
Retrieve files from archive
To get a file/folder from an archive, use the retrieve "path to file/folder" command. This will retrieve the file/folder from its original location.
By adding options to this command, you can change how to retrieve the file/folder. You can combine these options to retrieve files/folders, depending on what you need.
Retrieve file/folder to a different location
retrieve "path to file/folder" "path where to restore"
Retrieve sub folders
TSM doesn't retrieve content of sub folders by default. If you want to retrieve content of sub folders use:
retrieve "path to folder" -sub=yes
Retrieve by description
If you only want to retrieve files with a certain description, use
retrieve "path to file" -desc='description you want to retrieve'. ❗ Attention: The description must be inside the ' ' symbols.
Pick files/folders to retrieve
TSM can show you an interactive list of archived files/folders. This way you may select which files/folders to retrieve. This can be helpful if you only want to restore a file from inside a folder and don't know how the file was named. To show you the list of files use:
retrieve "path to file/folder" -pick.
Examples
- Retrieve a folder including all sub folders to a specific location.
retrieve "path to folder" "path to restore to" -sub=yes - Show a list of files/folder including sub folders with the description 'Very important data' and retrieve them to a specific location.
retrieve "path to folder" "path to restore to" -sub=yes -pick -desc='Very important data'
If you want to use an interactive shell, this would look like this:
dsmc -virtualnodename=archive.name.
If you use the terminal directly, this would look like this:
dsmc "your command" -virtualnodename=archive.name.
In both cases replace the archive.name with the archive name you want to access.