I am just 1 year old in Linux handling and almost novice in shell scripting & crontab scheduling.
I am trying to schedule some python script (standard python script come with HANA cdpy directory) using CRONTAB Â I have created shell script and that is running fine stand-alone.
But when I try to schedule this via CRONTAB then it is running  Actually it ignores that command and run everything else.
Would you please review?
Shell Script:
r3eomdbp1020:/usr/sap/KHA/SYS/global/sapcontrol/snapshots> cat fullDUMP.sh
#!/bin/bash #following command will create a full system info dump in /usr/sap/KHA/SYS/global/sapcontrol/snapshots
#now=$(date +"%m_%d_%Y")
/usr/sap/KHA/HDB01/exe/Python/bin/python /usr/sap/KHA/HDB01/exe/python_support/fullSystemInfoDump.py
#>> /bkup/FILESYS/FSID_$now.log #following command will move above created full system info dump to /bkup/FILESYS/ #echo #mv /usr/sap/KHA/SYS/global/sapcontrol/snapshots/fullsysteminfodump* /bkup/FILESYS/
I am just 1 year old in Linux handling and almost novice in shell
scripting & crontab scheduling.
I am trying to schedule some python script (standard python script come
with HANA cdpy directory) using CRONTAB ? I have created shell script
and that is running fine stand-alone.
But when I try to schedule this via CRONTAB then it is running ?
Actually it ignores that command and run everything else.
Would you please review?
_
SHELL_SCRIPT:_
R3EOMDBP1020:/USR/SAP/KHA/SYS/GLOBAL/SAPCONTROL/SNAPSHOTS> CAT
FULLDUMP.SH
#!/bin/bash #following command will create a full system info dump in
/usr/sap/KHA/SYS/global/sapcontrol/snapshots
#now=$(date +"%m_%d_%Y")
/usr/sap/KHA/HDB01/exe/Python/bin/python
/usr/sap/KHA/HDB01/exe/python_support/fullSystemInfoDump.py
#>> /bkup/FILESYS/FSID_$now.log #following command will move above created full system info dump to
/bkup/FILESYS/ #echo #mv /usr/sap/KHA/SYS/global/sapcontrol/snapshots/fullsysteminfodump*
/bkup/FILESYS/
With Linux the case used for file paths and names is important.
From the above it’s very hard to know whether the file path(s) or
name contain upper and/or lower case characters.
What you could do is add “>/tmp/cron.log 2 >&1” to the end of the
fullDUMP.sh line in your crontab entry which will log any output
from fullDUMP.sh to /tmp/cron.log. Going from the above I wonder
if fullDUMP.sh is really named with that mix of case?
HTH.
Simon Flood
Micro Focus (Novell/NetIQ) Knowledge Partner
in addition to Simon’s advice about logging the output of your script (as run by cron) to identify errors when invoking, please check that your script is actually an executable (perms 755 or alike).