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/dbdump.sh"
Here, the custom script "/opt/tivoli/tsm/client/ba/bin/dbdump.sh"
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.
Conclusion
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.