footprint_shards=`mysql_command "select shard_id,start,end from Backup where success=1 and restored=1 and metadata_corrected=1 and footprints_created=0"`
#echo ${footprint_shards} 2>&1 | tee -a $DEBUG_PATH
mysql_command "update Backup set footprints_created=1 WHERE shard_id=${shard_id} AND start=${start_seconds};"
fi
i=$(($i+3))
done
}
function create_tags()
{
echo"Create tags..." |2>&1 tee-a$DEBUG_PATH
echo"Create tags..." 2>&1 | tee-a$DEBUG_PATH
# get all shards without tags
tag_shards=`mysql_command "select shard_id,start,end from Backup where success=1 and restored=1 and metadata_corrected=1 and footprints_created=1 and tags_created=0"`
#echo ${tag_shards} 2>&1 | tee -a $DEBUG_PATH
# convert string output into indexed array
IFS=', 'read-r-a shard_array <<<"${tag_shards}"
len=${#shard_array[@]}
if[${len}-lt 3 ];then
echo"Cannot find shards for tag generation." 2>&1 | tee-a$DEBUG_PATH
return 0
fi
len=$((${len}-3))
i=0
while[$i-le${len}]
do
shard_id=${shard_array[i]}
start_seconds=${shard_array[i+1]}
#set start one week before to get tags for overlapping jobs