check for a file then lftp a different file to a directory
by lmu9@yahoo.com from LinuxQuestions.org on (#5ENF7)
This is for an Oracle E-business concurrent request. The request uses a file on the file system to lftp receipts to archive. It runs every 5 minutes to check for the file. If the file is not there, it should do nothing or say file is not there.
Process needs to check for 2 files, an *.ack file and an *.xml file in a directory. When the xml file is there, then move the ack file.
This code checks for a file, but i need to check for both files the *.ack file and *.xml file. When both are there move the ack file to archive.
if [ "$(ls -A $lclDirOut/*.*)" ]; then
echo "Files found in $lclDirOut"
cd $lclDirOut
chmod 777 *
lftp <<EOP
open $rserver
user $touser $topwd
echo "Copying files to Remote Server $vORacleFiles"
lcd $lclDirOut
mput *.*
bye
EOP
else
echo "No files found in $lclDirOut."
fi
Thank you for the help.


Process needs to check for 2 files, an *.ack file and an *.xml file in a directory. When the xml file is there, then move the ack file.
This code checks for a file, but i need to check for both files the *.ack file and *.xml file. When both are there move the ack file to archive.
if [ "$(ls -A $lclDirOut/*.*)" ]; then
echo "Files found in $lclDirOut"
cd $lclDirOut
chmod 777 *
lftp <<EOP
open $rserver
user $touser $topwd
echo "Copying files to Remote Server $vORacleFiles"
lcd $lclDirOut
mput *.*
bye
EOP
else
echo "No files found in $lclDirOut."
fi
Thank you for the help.