Operating System - HP-UX
1833873 Members
1762 Online
110063 Solutions
New Discussion

DP command on a script inside the cron

 
Gianni Bini
Occasional Contributor

DP command on a script inside the cron

Hi All,

I'm trying to execute a Data Protector command inside an script, the script executed interactivly runs ok but when I execute it from the cron the result is not good at all. The command inside the script are the following:
-----------------------------------------------------
#!/sbin/sh
uma=/opt/omni/lbin/uma
wdir=/home/fgarcia/scripts/tapes/vaulting
device=/dev/rac/ESL_picker

${uma} -ioctl ${device} -barcode < ${wdir}/log/uma_X.in > ${wdir}/log/Xslots_free.log 2>&1
#${uma} -ioctl ${device} -barcode < ${statx} > ${wdir}/log/Xslots_free.log
xSlot=$(cat ${wdir}/log/Xslots_free.log|grep -c Empty)
xSlot=$(expr $xSlot - 9 )
echo 'Slot x free: ' ${xSlot} >> ${wdir}/log/action.log

-----------------------------------------------------

inside the uma_X.in there is only one instruction stat x, so the script should return inside the Xslots_free.log file the status of the removable slots of the library.
The contents of the file Xslots_free.log in a normal run is:
/dev/rac/ESL_picker> stat x

8192 X1 Full "000626L2" ""
8193 X2 Empty "" ""
8194 X3 Empty "" ""
.......

the contest of the file after a run from the cron is the following:
)0 UMA HP OpenView OmniBack II A.05.50V15 ^G^A[12:1] ^G^B[2004] ^G^E1138800661 UMA itdcmae6 ^G^A[90:13] (unnamed) (unnamed)
^D61]15 ^G^A[12:1] ^G^B[2003] ^G^E1138800661 UMA itdcmae6 ^G^A[90:28] Details unknown. (unnamed)V15 ^G^A[12:1] ^G^B[2
004] ^G^E1138800661 UMA itdcmae6 ^G^A[90:19] (unnamed) (unnamed)^F1 1


I have already try with:
- changing the shell
- include the same environment variables as root (interactive session)
- Include the 2>&1 in the entry of the cron

Any idea will be more than wellcome.
Thanks in advance,
Federico.
1 REPLY 1
Pete Randall
Outstanding Contributor

Re: DP command on a script inside the cron

"inside the uma_X.in there is only one instruction stat x"

Does the "stat x" command use a full path name?


Pete

Pete