Running a Bash script over ssh

The shell on the local host is doing variable substitution on $NOW and $BACKUP because the “EOI” isn’t escaped. Replace

 ssh [email protected] <<EOI

with

 ssh [email protected] <<\EOI

Leave a Comment