sftp

Processing SFTP files using C# Parallel.ForEach loop not processing downloads

佐手、 提交于 2020-12-30 03:33:05
问题 I am using the Renci SSH.NET package version 2016. I am downloading files from an external server. I usually can download about one file every 6 seconds which is bad when you have thousands of files. I recently tried to change the foreach loops to Parallel.ForEach . Doing that changed the files downloaded times to 1.5 seconds. Except when I checked the files they all had 0 KB's so it did not download anything. Is there anything wrong with the parallel loop? I am new to C# and trying to

Processing SFTP files using C# Parallel.ForEach loop not processing downloads

大城市里の小女人 提交于 2020-12-30 03:28:04
问题 I am using the Renci SSH.NET package version 2016. I am downloading files from an external server. I usually can download about one file every 6 seconds which is bad when you have thousands of files. I recently tried to change the foreach loops to Parallel.ForEach . Doing that changed the files downloaded times to 1.5 seconds. Except when I checked the files they all had 0 KB's so it did not download anything. Is there anything wrong with the parallel loop? I am new to C# and trying to

Slow upload of many small files with SFTP

家住魔仙堡 提交于 2020-12-30 03:01:11
问题 When uploading 100 files of 100 bytes each with SFTP, it takes 17 seconds here ( after the connection is established, I don't even count the initial connection time). This means it's 17 seconds to transfer 10 KB only, i.e. 0.59 KB/sec! I know that sending SSH commands to open , write , close , etc. probably creates a big overhead, but still, is there a way to speed up the process when sending many small files with SFTP? Or a special mode in paramiko / pysftp to keep all the writes operations

Slow upload of many small files with SFTP

老子叫甜甜 提交于 2020-12-30 03:01:05
问题 When uploading 100 files of 100 bytes each with SFTP, it takes 17 seconds here ( after the connection is established, I don't even count the initial connection time). This means it's 17 seconds to transfer 10 KB only, i.e. 0.59 KB/sec! I know that sending SSH commands to open , write , close , etc. probably creates a big overhead, but still, is there a way to speed up the process when sending many small files with SFTP? Or a special mode in paramiko / pysftp to keep all the writes operations

Slow upload of many small files with SFTP

核能气质少年 提交于 2020-12-30 03:00:21
问题 When uploading 100 files of 100 bytes each with SFTP, it takes 17 seconds here ( after the connection is established, I don't even count the initial connection time). This means it's 17 seconds to transfer 10 KB only, i.e. 0.59 KB/sec! I know that sending SSH commands to open , write , close , etc. probably creates a big overhead, but still, is there a way to speed up the process when sending many small files with SFTP? Or a special mode in paramiko / pysftp to keep all the writes operations

From Python run WinSCP commands in console

為{幸葍}努か 提交于 2020-12-04 05:32:36
问题 I have to run a few commands of WinSCP from a Python class using subprocess. The goal is to connect a local Windows machine and a Windows server with no FTP installed and download some files. This is what I tried python proc = subprocess.Popen(['WinSCP.exe', '/console', '/WAIT', user:password@ip:folder , '/WAIT','get' ,'*.txt'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) With this I get it to open the WinSCP console and connect to the server, but it doesn't execute the get

From Python run WinSCP commands in console

♀尐吖头ヾ 提交于 2020-12-04 05:29:31
问题 I have to run a few commands of WinSCP from a Python class using subprocess. The goal is to connect a local Windows machine and a Windows server with no FTP installed and download some files. This is what I tried python proc = subprocess.Popen(['WinSCP.exe', '/console', '/WAIT', user:password@ip:folder , '/WAIT','get' ,'*.txt'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) With this I get it to open the WinSCP console and connect to the server, but it doesn't execute the get

From Python run WinSCP commands in console

大兔子大兔子 提交于 2020-12-04 05:28:36
问题 I have to run a few commands of WinSCP from a Python class using subprocess. The goal is to connect a local Windows machine and a Windows server with no FTP installed and download some files. This is what I tried python proc = subprocess.Popen(['WinSCP.exe', '/console', '/WAIT', user:password@ip:folder , '/WAIT','get' ,'*.txt'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) With this I get it to open the WinSCP console and connect to the server, but it doesn't execute the get

“Renci.SshNet.Common.SshException: Invalid private key file” when loading SSH private key from configuration string using SSH.NET

百般思念 提交于 2020-12-01 09:35:20
问题 I'm trying to send a file to some server using SFTP. During this process I'm getting the exception Renci.SshNet.Common.SshException: Invalid private key file. at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase) Generated the keys using PuTTYgen, shown below is an sample format of private key file. It has both the public and the private keys. PuTTY-User-Key-File-2: ssh-rsa Encryption:none comment: rsa-key-20190327 Public-Lines: 4 AAAAB..... ...... Private-Lines: 8 AAAAgQ.

How to increase the performance of a file upload using native sftp functions and fwrite in PHP

痞子三分冷 提交于 2020-11-29 03:48:29
问题 Hi I am using the following code to upload a huge file (500MB) to a sftp server. <?php $connection = ssh2_connect($this->host, $this->port, null); $sftp = ssh2_sftp($connection); $connection_string = ((int) $sftp) . $remotePath . $remoteFilename; $stream = fopen('ssh2.sftp://' . $connection_string, 'w'); $source = fopen($localFilepath, 'r'); if (!$stream) { throw new Exception('Could not create file: ' . $connection_string); } while (!feof($source)) { // Chunk size 32 MB if (fwrite($stream,