[bash] Getting ssh to execute a command in the background on target machine

Quickest and easiest way is to use the 'at' command:

ssh user@target "at now -f /home/foo.sh"