Hi all,
I have written one script. it is working fine. But when I am going to run this script through SAP in sm37 job it is giving error.
Code:
Ext. prog.: Can't exec external program (Exec format error)
Ext. prog.: External program terminated with exit code 1
Ext. prog.: SAPXPG started on cpcsaps2_RS2_35, Process ID 22001, Process Number 12
External program was cancelled
Job cancelled
#!/bin/ksh
print '================================================'>> log_core
delcnt=0
delcnt_old=0
for files in `find ./ -name core_test -mtime -5 -type f -print`
do
echo " $files Deleted : " `date +%Y-%m-%d.%Hh%Mm%Ss`\n >> log_core
delcnt=$(($delcnt + 1))
/bin/rm $files
done
for oldfiles in `find /usr/sap/RS2/DVEBMGS35 -name core_test_old -mtime -5 -type
f -print`
do
echo " $oldfiles moved to : /usr/sap/RS2/core_old \n">>log_core
delcnt_old=$(($delcnt_old + 1))
/usr/bin/mv $oldfiles /usr/sap/RS2/core_old
done
echo "deleted $delcnt files">> log_core
echo "$delcnt_old files moved ">> log_core
#this is for mail text
curmth=`date +%m`
set -A mth Dec Jan Feb March April May June July August Sept Oct Nov Dec
prevmth=${mth[$((curmth + 1))]}
season1='Hi,\n The two month old below files moved to the new location.'
season2='Kindly have a look on them.these files will be automaticaly deleted onw
1st'
#mail text end
echo "${season1} ${season2} $prevmth \n">>log_core
print '====================End==========================='>> log_core
if [[ $delcnt -ne 0 || $delcnt_old -ne 0 ]];
then
cat /usr/sap/RS2/email_list | while read emails
do
echo $emails
mailx -r alert -s "Core Deletion" $emails<log_core && mailq
echo Mail Sent Successfully
done
fi
rm log_core
Last edited by Scott; 02-22-2010 at 05:28 PM..
Reason: Removed formatting, added code tags
Dear all, I am very new to UNIX but and need some help in order to make BO DI Job Server execute a .sh script.
My unix script has set permissions as under:
-rwxrwxrwx.
What I m trying to do is move a .txt file from one directory to another on UNIX server. I have full access to Feed... (7 Replies)
Hi
Has anyone worked in SAP/Netweaver.
Im looking for some basic unix commands for SUN servers.
Unix commands like check if the java server is running or not..etc
please help thanks -m77 (1 Reply)
Hi bros,
i'm new HP-UX user actually we use SAP over unix some problems faced me when the log files in SAP directory full then i need sample way to extend folder size for SAP logs or to make it auto extend
Thanks (1 Reply)
Hello all.
My company is installing an SAP ERP financials. The consultants are asking me to allocate 30Gbytes of swap. This is on a dedicated Linux box running Redhat 5 64Bit OS. It has 16GB of RAM.I have asked for an explanation but all I'm getting is that this is what SAP recommends. It seems... (2 Replies)
Hi there all..
I got SAP running on AIX systems.
Now I got SNMP running and it is collecting info.
But I want the SAP MIB to be running so I can also retrieve SAP info.
How can I neable it on AIX?
When I do a MIB walk on SAP it isnt showing anything.
Thanx in advance! :) (1 Reply)