Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I posted a question earlier today asking " How to copy folders from local to a remote server with files present in the folders?"
Unfortunately, I haven't got any reply.
So I followed someone's suggestion for a similar question online -
"you could create a zip or tar of the directory and its subfolders w/ files. Then, use tSFTP to transfer the files. Then, use tSsh to connect again and untar / unzip the file, containing subfolders and files."
Here is what I did:
1) With tFileArchive, I created a zip file for the folder and its subfolders w/ files in local machine;
2) With tFTPPut, I moved the zip file to the remove server;
Then I am stuck now. Don't know if I did step 1) and 2) correctly. And I couldn't find enough information for tSSH : Whether it can unzip the file on the remote server? If it can, How?
Thanks!
All you need to do is use the command to unzip files at remote server
unzip zipfilename.zip -d destination_directory
Sample -
As you could see, you have the option to provide multiple commands in the tSSH using the command separator.
Thank you iamabhishek for your reply!
I think the most difficult part for me is to set up the connection correct for tSSH.
Hi iamabhishek,
I used the same Username, Host, Port as I used in tFTPConnection.
In my tFTPConnection I used "Public Key" Authentication method with a private key file, so I used the same in tSSH. But I had no luck - (BTW, the Schema was set to be "Built-In" and the Key Passphrase I used the defaulted)
statistics] connecting to socket on port 3958
[statistics] connected
Exception in component tSSH_1 (movefiles)
java.io.IOException: The execute request failed.
at ch.ethz.ssh2.channel.ChannelManager.requestExecCommand(ChannelManager.java:764)
at ch.ethz.ssh2.Session.execCommand(Session.java:256)
at ch.ethz.ssh2.Session.execCommand(Session.java:229)
at pl_project.movefiles_0_1.movefiles.tSSH_1Process(movefiles.java:394)
at pl_project.movefiles_0_1.movefiles$2.run(movefiles.java:734)
Caused by: java.io.IOException: The server denied the request.
at ch.ethz.ssh2.channel.ChannelManager.waitForChannelSuccessOrFailure(ChannelManager.java:235)
at ch.ethz.ssh2.channel.ChannelManager.requestExecCommand(ChannelManager.java:760)
... 4 more
[statistics] disconnected