Hi Cameron,
Thanks for the prompt reply. The script really help me to get an idea.
Still have some doubt here.
I have modified the script to as below. I put all the datafile name from the source directory into a file name "mydatafile", in tend to load the datafile by the ordering in the file. The data able to pick up one by one when the destination location has no data, but is not follow the sequence order in the file. How to make it read the file by order?
mydatafile
----------
GGESC00A.2004:01:19:05:00:00.CLIpm
GGESC00A.2004:01:19:05:15:00.CLIpm
GGESC00A.2004:01:19:05:30:00.CLIpm
GGESC00A.2004:01:19:05:45:00.CLIpm
#!/bin/ksh
while [ -f /tmp/hs/source/* ]
do
while read line
do
echo $line
if [ ! -f /tmp/hs/destination/* ] && [ -f /tmp/hs/source/* ]
then
echo 'Transferring file: '$line >> seq_log
mv /tmp/hs/source/$line /tmp/hs/destination/
echo 'Transfer completed.'
else
echo 'File: '$line': loading in progress######'
while [ -f /tmp/hs/destination/* ]
do
echo '**********'
done
sleep 5
if [ ! -f /tmp/hs/destination/* ] && [ ! -f /tmp/hs/source/* ]
then
echo 'File: '$line': loading completed'
fi
fi
done < mydatafile
done