Here are a simple script to automatic import OT on Linux and UNIX systems:
firt step: Unix - Linux script:
############### Begin Script ##################################################################
#!/bin/sh
#funtion import
Import () {
i=$1
/usr/sap/QAS/SYS/exe/run/tp ADDTOBUFFER $i QAS pf=/usr/sap/trans/bin/TP_DOMAIN_DEV.PFL
/usr/sap/QAS/SYS/exe/run/tp IMPORT $i QAS client=400 pf=/usr/sap/trans/bin/TP_DOMAIN_DEV.PFL U2
VALOR=$(echo $?)
if [ $VALOR -gt 4 ]
then
echo "Error in $i output $VALOR"
fi
}
#Main script - change name file and de import the OT
cd /usr/sap/trans/
for InFile in `find ./data -mmin -15 -type f -name "R*.DEV" -print`
do
ls -l $InFile
xNum=`echo $InFile | awk -F \/ '{print $3} ' | cut -c2-7`
OutFile=`echo DEVK${xNum}`
sleep 40
echo "Importing... : $OutFile"
Import $OutFile
done
############# END script ##################################################################
Sencod step: now we can schedule the script con crontab Unix:
0,15,30,45 * * * * /usr/sap/trans/import.sh >>/tmp/log.log 2>&1
now you can view the result on the log file /tmp/log.log