Let me describe your problem to see if I correctly understand what is going on.
Your problem is that you want to run a program on another machine, and you want your program to not wait for it. What you're doing is sshing into that machine, running your command in the background, and exiting. Your problem is that the ssh shell stubbornly will not return until the subprocess is all done, which means that you're waiting for the process to finish, which is what you didn't want.
If that is what is happening, then the simplest solution is to use the at command in this form.
ssh root@ip 'echo $command | at now'
This will queue up the job to run using the batch system immediately. Your ssh session should return immediately. Depending on how cron has been configured, any output likely comes to someone in email. |