I am banging my head against a wall and I'm certain I'm just being dense.
I am attempting to run a for loop with a lftp command against files in a watched folder basically a backup and move process. But due to the way LFTP and the loop works if I process files on the destination before everything is done I get a failure.
So what I want to do is read all files with *.log and then if there are say 20 files only process 10, then on its next run process 10 files again eventually it will be at a point of 1 file at a time. I can loop through everything fine. just can not seem to figure out how to only read the first 10 files as I say.
for FILE in *.log; do
lftp -p 2252 -u $FTPUser,$FTPPass $Location <<EOF
set ftp:ssl-allow no
set xfer:use-temp-file on
set xfer:temp-file-name *.tmp
set log:file/xfer /log/LFTP_$FILE.log;
mput $LogPath/$FILE
quit
EOF
if [ $? == "0" ]; then
rm $LogPath/$FILE
else
echo "Error"
fi
done;