July 2007
IBM's Tivoli is a storage solution that the RuG uses for backup/restore. It can be downloaded here. Documentation for the client is supposed to be here, but that takes you to a generic entry point where you have to search for the correct route to the actual docs first. I find this a good starting point.
The java we're going to use needs libstdc++5
:
apt-get install libstdc++5
The java-based dsmj
needs the Korn shell, so we install that:
apt-get install ksh
The dsmj
executable supports only java 1.4 and no higher. SUN doesn't offer version 1.4 for amd64. So we try Blackdown java:
Download: ftp://ftp.easynet.be/blackdown/JDK-1.4.2/amd64/rc1/j2re-1.4.2-rc1-linux-amd64.bin
As an ordinary user, create the package: fakeroot make-jpkg /tmp/j2re-1.4.2-rc1-linux-amd64.bin
Install the package: dpkg -i ~jurjen/blackdown-j2re1.4_1.4.2+rc1_amd64.deb
We fetch the software [34]
wget ftp://service.boulder.ibm.com/storage/tivoli-storage-management/maintenance/client/v5r4/Linux/Linux86/v541/5.4.0.0-TIV-TSMBAC-LinuxX86.tar && \
wget ftp://service.boulder.ibm.com/storage/tivoli-storage-management/maintenance/client/v5r4/Linux/Linux86/v541/5.4.1.0-TIV-TSMBAC-LinuxX86.tar
Unpack the tarfiles with:
for TAR in `ls -1 *.tar` ; do
DIR=`basename $TAR .tar`
mkdir $DIR &&
pushd $DIR &&
tar xf ../$TAR &&
popd
done
alien Fails miserably, so we unpack all the rpms with:
for DIR in `ls -d1 *LinuxX86` ; do
UNPACK=${DIR}/unpack \
if mkdir ${UNPACK} && pushd ${UNPACK} ; then
for RPM in `ls -1 ../*.rpm` ; do
rpm2cpio ${RPM}|cpio -idmv --no-absolute-filenames
done
popd
fi
done
Copy the ./opt
files into place:
cp -ru 5.4.0.0-TIV-TSMBAC-LinuxX86/unpack/opt/tivoli /opt/
cp -ru 5.4.1.0-TIV-TSMBAC-LinuxX86/unpack/opt/tivoli /opt/
Not all the programs in {dsmc
, dsmj
, dsmagent
} react identically to setting the DSM_DIR
environment variable.
So in order to avoid using that variable, we run all these programs from the directory they reside in.
They then still search for message files in locations where they are not, so we fool them with a symlinks:
pushd /opt/tivoli/tsm/client/ba/bin/ && \
ln ../../lang/en_US/ ./
We also want our config in /etc/
, so we create /etc/tivoli
and link into it:
pushd /opt/tivoli/tsm/client/ba/bin/ && \
ln -s /etc/tivoli/dsm.sys ./ && \
ln -s /etc/tivoli/dsm.opt ./
Link a xerces
library sought by dsmagent
into place:
pushd /opt/tivoli/tsm/client/api/bin && \
ln -s libxerces-c1_6_0.so libtsm541xerces-c1_6_0.so
We can now run the dsmc binary with the following script:
#!/bin/bash # The executable to run TIVOLI=/opt/tivoli/tsm/client/ba/bin/dsmc #TIVOLI=/opt/tivoli/tsm/client/ba/bin/dsmagent #TIVOLI=/opt/tivoli/tsm/client/ba/bin/dsmj export PATH="/usr/lib/j2re1.4-blackdown/bin:$PATH" HOST=`hostname` # I don't know why we set these export LANG='en_US.iso88591' export -n LC_CTYPE # Now I do: we want files with diacritics in their names to be backed up too export LANG=en_US export LC_TYPE=en_US export LC_ALL=en_US export DSM_LOG='/var/log/tivoli/' # Tivoli is not properly packaged for Debian, and brings its own libraries in /opt, # so we set LD_LIBRARY_PATH accordingly export LD_LIBRARY_PATH="/opt/tivoli/tsm/client/api/bin;\ /opt/tivoli/tsm/client/api/bin64;\ /opt/tivoli/tsm/client/ba/bin/plugins;\ /opt/tivoli/tsm/client/hsm/bin;\ /opt/tivoli/tsm/client/icc32/icc/icclib;\ /opt/tivoli/tsm/client/icc64/icc/icclib" pushd `dirname ${TIVOLI}` exec ./`basename ${TIVOLI}` $@
Warning | |
---|---|
Heiko reports that setting export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8 works, and the wrapeer script doesn't. |
We edit /etc/tivoli.dsm.opt
to contain:
COMPRESSALWAYS YES ARCHSYMLINKASFILE NO DATEFORMAT 3 NUMBERFORMAT 4 DOMAIN / /boot /home /opt /spareboot /usr /usr/local /var /srv/si /srv/ftp
And we put in /etc/tivoli/dsm.sys
:
SERVERNAME ADSM COMMMethod TCPip TCPPORT 1500 TCPSERVERADDRESS your.backupserver.com NODENAME provided.bythebackupadmin PASSWORDACCESS GENERATE RUNASSERVICE YES COMMMethod TCPip SCHEDMODE PROMPTED TCPBUFFSIZE 32 TCPWINDOWSIZE 64 Largecommbuffers yes
In the above dsm.sys
, we temporarily set RUNASSERVICE
to NO
.
Then we run the dsmc program once and issue the command query schedule so it starts a session with the server and provides for an automatically updated password in /etc/adsm/TSM.PWD
.
And we set it back to YES
.
We can now start dsmj by slightly modifying It will still give us errors after some time, but it runs long enough to exclude some ftp mirrors from being backed up.
In order to be backed up nightly, the server needs to have the scheduler running, which is started by dsmc sched.
We create an initrc from /etc/init.d.skeleton
and make it start and stop saying update-rc.d tivoli defaults.