Hi All
Anyway of resolving this issue.
I have created a script which works properly only issue is occasionaly when the tar.Z file is emailed to me i get this message this only happens sometimes??
begin 644 /var/tmp/aimtl-20080626.txt.tar.Z
M'YV08=*TH=.	LP+63 @($#A@T9-ES0P4,'@,6+&#-JW,BQH\>/( $L7&B#
M!@V1,&+ H $1)0R%-6"@E!$CQ@T;,6C,D &@)HP9,60HC%'#!DJB,&KPE!FR
MJ=.G4*-JK#.'3A@Y*.O@4)B4I]2,;\CDF3.G3)ZO&4>FE%'#Y4BC:./*G4NW
M;MTI5*9\H2(G#)DR7Y(022#DS9LU@0</J2-'3ADW8_)\&1*V3 *^?@%3R0/'
M\I,[;LK(^3(%BI,$GT./9E($-6C17YY426 E#)LZ8>BD>>-F+V?+4^@X#M,F
end
Here is my script i have to use tar and compress by the way.
#!/bin/ksh
#set -o xtrace
DTE=`date +%Y%m%d`
TPATH="/apps/prod-dom/prod/data/formatter/MO_app/archive"
###############################################################################
#Checking Base Directory available, abort if errors
###############################################################################
if [[ ! -r $TPATH ]]
then
print "Error - Base directory does not exist or is unreadable:"
print " "$TPATH
exit -1
fi
###############################################################################
# Checking for the required file
# Sleeps for 10 minutes and rechecks for incoming file
###############################################################################
print "todays date is "$DTE
TZ=GMT+24
DTE1=`date +%Y%m%d`
file1=aimtl-$DTE1.txt
FILE_THERE=NO
while [ $FILE_THERE != YES ]
do
if [ -e $TPATH/$file1 ]
then
print "The file exist"
print "Sleeping for 10 minutes zzzzz"
sleep 600
cp $TPATH/$file1 /var/tmp
FILE_THERE=YES
else
print $TPATH/$file1
print "File printed above with the '.txt' at the end is missing.Sleeping & Rechecking $TPATH"
sleep 600
fi
done
#Zip the file
cd /var/tmp
file=/var/tmp/$file1.tar
/usr/bin/tar -cvf $file $file1
compress $file
sleep 120
TZ=GMT+24
YESTERDAY=`/usr/bin/date +"%a %d %h %Y"`
/usr/bin/uuencode $file.Z $file.Z | /usr/bin/mailx -s "Report for COB $YESTERDAY" "joe.blogs@hotmail.com"
sleep 60
rm -f $file
rm -f $file.Z
rm -f /var/tmp/$file1