Quick tar/ssh snippet

If I have to transfer files from work, I transfer them to the nslu2/slug then pull them off later at my leisure. The drive attached to the slug died yesterday, and I found it delightfully simple to still use the firewall accessible slug to bounce the data to my desktop machine.

$ tar -cf - c:\temp\* | ssh dean@nslu2.asdf.com "ssh desktop.asdf.com 'cd temp; tar -xvf-' "

Basically, tar the data into one stream, send it across ssh to the slug, send it across ssh to the desktop, and unpack the stream while displaying the list of files. If my desktop were directly accessible, and not firewalled:

$ tar -cf - c:\temp\* | ssh desktop.asdf.com 'cd temp; tar -xvf-'

No comments: