proutil db-name -C holder
|
Return code
|
Description
|
0
|
The database is not in use
|
14
|
The Database is locked by single user, PROUTIL, or RFUTIL
|
16
|
The database is open in multi-user mode
|
proutil mydb -C holder
retcode=$? # this saves the return code case $retcode in 0) echo "The database is not busy, ok to backup" ;; 14) echo "The database is locked, no backup done" exit $retcode ;; 16) echo "The database is busy in multi-user mode, no backup done" exit $retcode ;; *) proutil failed, no backup done echo error code = $retcode exit $retcode ;; esac proutil mydb -C truncate bi <<test the return value from proutil here>> <<put the backup command here>> rfutil mydb -C mark backedup |