The shell on the local host is doing variable substitution on $NOW and $BACKUP because the “EOI” isn’t escaped. Replace
ssh tunneluser@111.222.333.444 <<EOI
with
ssh tunneluser@111.222.333.444 <<\EOI
The shell on the local host is doing variable substitution on $NOW and $BACKUP because the “EOI” isn’t escaped. Replace
ssh tunneluser@111.222.333.444 <<EOI
with
ssh tunneluser@111.222.333.444 <<\EOI