Quantcast
Channel: Planet PostgreSQL
Viewing all articles
Browse latest Browse all 9825

Dave Cramer: scp protocol using jsch

$
0
0

Using Jsch to  scp a file to a remote computer I found Jan Pechanec's excellent blog how_the_scp_protocol_works . The one thing I couldn't figure out was how to specify the remote directory. 

Originally I tried using D mode dir to specify the directory. That results in an error.

As you can specify the target directory using scp manually there must have been a way. Turns out it is simple.

Line 43 of scp is String command="scp " + (ptimestamp ? "-p" :"") +" -t "+rfile; 

All that is required is to specify the target dir in the command as follows:

String command="scp " + (ptimestamp ? "-p" :"") +" -t "+targetDir+'/'+rfile;



Viewing all articles
Browse latest Browse all 9825

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>