#!/bin/bash
export LANG=us

datai=2022120100
dataf=2023022823

while [ $datai -le $dataf ] ; do
 if [ $(ps -auxwww |grep recorta_goes_BRA.ksh |grep -v color=auto |wc -l) -le 5 ] ; then
  /share/ioper/tempo/MERGE/GOES/IR/recorta_goes_BRA.ksh $datai &
  datai=$(date -u -d "${datai:0:8} ${datai:8:2}:00 1 hours  " "+%Y%m%d%H")
 else
  sleep 10
 fi
done
