forked from URZ/admin-tools
Initial commit
This commit is contained in:
20
RunTivoliBackup.sh
Executable file
20
RunTivoliBackup.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ou pipefail
|
||||
|
||||
LASTRUN="/var/lib/runtime/$(basename "$0" .sh).lastrun"
|
||||
|
||||
if [[ $(pgrep -c "$(basename "$0" .sh)" ) -gt 1 ]]; then
|
||||
echo "Script already running. Abort!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
/usr/bin/dsmc inc >> /var/log/tivoli/tsm.log 2>&1
|
||||
DSMCRETURN=$?
|
||||
if [[ "$DSMCRETURN" -ne 0 && "$DSMCRETURN" -ne 8 ]]; then
|
||||
echo "Error during dsmc execution occurred." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
date +%s > "$LASTRUN"
|
||||
exit 0
|
||||
Reference in New Issue
Block a user