Rerunning the code another 5 times doesn't help either.
It's still the same error. And it had been working so well for so many days. The code in question
if [[ $SDAY -eq $EDAY && $SMON -eq $EMON && $SYEAR -eq $EYEAR ]]; then
echo "Data is current for $value_set"
You know you're good at shell scripting when you start making elementary mistakes and enter brain freeze territory frequently. I mean, your code can't just stop like that, can it?
And slowly you wrack your brains to see what you should be looking at.
Finally you read the error message and figure out that this is something to do with the base system.
You google and smack your head and realise, the dates were being read as octal and like clockwork it fails on 09th of April. You start to think of all the code to strip leading 0s and suitably chastened you stick to a simpler version which goes like
if [[ "$EYEAR$EMON$EDAY" -eq "$SYEAR$SMON$SDAY" ]]; then
echo "No deltas to be captured"
The dates have to match, so it doesn't matter if it is a string or number.
Overconfidence, the bane of a programmer.