in reply to system and pipes

Why not just...

system("/usr/bin/tar -cz /opt/back | /usr/bin/ssh myname@remote.host.com 'dd of=/opt/rback/back.tar.gz'");