Command line file transfer client with gateway support?
I can't seem to find anything, but I figured I'd ask here before I spend the time trying to write something...

I need a Linux command line file-transfer client (scp or sftp), which supports tunneling through a gateway (obvious also just "normal" transfers). It needs to be able to transfer files and directories.

Right now, I open a ssh tunnel, track the process ID, and use rsync to copy files through localhost and the port opened, and when that completes closing the tunnel using the PID. The problem ends up being that sometimes that tunnel closes prematurely, and it just screws up our entire deployment.

So, do any such clients exist? My Google-Foo has failed me so-far.

Thanks!
Command line file transfer client with gateway support?
===

I can't seem to find anything, but I figured I'd ask here before I spend the time trying to write something...

I need a Linux command line file-transfer client (scp or sftp), which supports tunneling through a gateway (obvious also just "normal" transfers). It needs to be able to transfer files and directories.

Right now, I open a ssh tunnel, track the process ID, and use rsync to copy files through localhost and the port opened, and when that completes closing the tunnel using the PID. The problem ends up being that sometimes that tunnel closes prematurely, and it just screws up our entire deployment.

So, do any such clients exist? My Google-Foo has failed me so-far.

Thanks!