Pages

Wednesday, June 6, 2018

sample waiting script, waits for 60 minutes and fails after that.


sample script


okFile=okay.ok
bFlagFound=false
waitCounter=0

while [ "$bFlagFound" = "false" ]; do
        if [ -e $okFile ]; then
                bFlagFound=true
        else
                sleep 60
                waitCounter=$(($waitCounter + 1))
                if [ $waitCounter -gt 60 ]; then
                        echo "$okFile flag not found, after waiting 60 minutes"
                        exit 1
                fi
        fi
done




echo "task 1"
echo "task 2"



No comments:

Post a Comment