Another approach used to compress the files, which is to use own java remote
machine, the command is as follows String command = "(cd / outputs; jar cvfM
test.zip RTS *)";

the problem now is that the windows when I use the Channel, the mapping of
the directory / outputs is absent, while using the ChannelSftp is possible.


How is it possible to execute commands remotely using ChannelSftp?
---~--~--~---------~--~----~------------~-------~--~----~




2012/2/14 Xamag Productions <[email protected]>

>  hi,
>
> I used the code below to make the compression, but now the problem is
> another, only works for the Linux server, while my remote server runs
> windows.
>
> there is something you can do so this code works there?
>
> thank you.
>
>  public void compress(String dir) throws Exception  {
>
>         String command="(cd /saidas; tar -cvf Xamag.tar RTS*)";
>
>         Channel channel=_session.openChannel("exec");
>
>            ((ChannelExec)channel).setCommand(command);
>
>            channel.setInputStream(null);
>            ((ChannelExec)channel).setErrStream(System.err);
>
>            channel.connect();
>
>            while(true){
>              if(channel.isClosed()){
>                System.out.println("exit-status: "+channel.getExitStatus());
>                break;
>              }
>              try{Thread.sleep(1000);}catch(Exception ee){}
>            }
>            channel.disconnect();
>
>     }
> ---~--~--~---------~--~----~------------~-------~--~----~
>
>
>
>
> 2012/2/14 Atsuhiko Yamanaka <[email protected]>
>
>> Hi,
>>
>>   +-From: Xamag Productions <[email protected]> --
>>   |_Date: Tue, 14 Feb 2012 08:52:15 +0200 _________
>>   |
>>   |* Also, are you transferring a lot of small files, or a lot of big
>> files?*
>>    |I try to transfer many small files with the following characteristics
>>   |Type: plain text document (text / plain)
>>   |Size: 110 bytes (110 bytes)
>>    |* What exactly is the problem? *
>>    |these files reach up to 46,000 files per day, and I have to transfer
>>   |only one afternoon and how forces are taking about 1.5 seconds for
>>   |each file I can not give vent to demand.
>>
>> If it is needed by myself, rather than using sftp,
>> I'll exec remtely "(cd /somewhere; tar czf - .)" and extract files
>> on the local.
>>
>>
>> Sincerely,
>> --
>> Atsuhiko Yamanaka
>> JCraft,Inc.
>> 1-14-20 HONCHO AOBA-KU,
>> SENDAI, MIYAGI 980-0014 Japan.
>> Tel +81-22-723-2150
>> Skype callto://jcraft/
>> Twitter: http://twitter.com/ymnk
>> Facebook: http://facebook.com/aymnk
>>
>
>
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to