I have been at this most of the morning but had to work, so I am back and hoping somebody can help me figure this out.
This line works
dest="$user@$dest:$( hostname )"
# dest=me@remotehost.com:MyMachineHostname
This like I am really struggling with, I want to be able to run this on several hosts just by uploading the file and setting a cron job.
dir=$(( $unique == 1 ? ":"$( hostname ) : "" ))
dest="$user@$dest$dir"
When unique == 1 then the colon and hostname could be set to $dir, if not it should be empty.
This is definitely not PHP, so much harder.
I have tried many variations of brackets, braces without any without $ The closest I got was having :myhostname but with lots of the other chars around it.
It's very frustrating.