Expert GuideHow to run commands before a backup automatically with IBM Storage Protect

Claus Küthe & Oliver Ladage — 20. November 2023
Reading time: 0:26 Minutes

Wir haben bereits vorgestellt, wie man Befehle vor Beginn einer geplanten Sicherung mit IBM Storage Protect Plus ausführt. Dies ist auch mit IBM Storage Protect möglich.

Our colleague Oliver Ladage previously presented how to execute commands before starting a scheduled backup with IBM Storage Protect Plus. This is also possible with IBM Storage Protect. We describe here how this works and what the benefits are.

In a previous article, we introduced and explained why it can be useful to execute commands before starting a scheduled backup with IBM Storage Protect Plus. With the following steps you can also do this with IBM Storage Protect. This article shows you how to do it:


Add the preschedulecmd directive to the configuration /opt/tivoli/tsm/client/ba/bin/dsm.sys:


preschedulecmd "/opt/tivoli/tsm/client/ba/bin/"
Here, the custom script "/opt/tivoli/tsm/client/ba/bin/" is run, which is supposed to dump a database running on the server. You can use similar approaches to prepare backups of other files for which you have to expect concurrent writes during a backup. 


Doing so, you should of course exclude the directory which holds files which should not be backed up by IBM Storage Protect: 


exclude.dir /var/lib/mysql


Important: do not use a trailing „/“ here.

Benefits you gain using this command before you back up data in IBM Storage Protect

This approach can be used to back up files where you expect write access during the backup.


Good practice when backing up databases

You should never assume that you can backup a database „at night“ because no one is working with it; a live database may produce concurrent writes even if no one is working with it.


Powering down databases before backup and bringing them up is a dangerous approach as well, as databases are very dependent on having the same version and hardware architecture. 


With this simple directive you can

  • guarantee that, for example, a dump of an SQL database is executed immediately before the backup by IBM Storage Protect;
  • you have a consistent database in your backup.

You were interested in this, then you may also be interested in...