I'm trying to transfer a 1 GB file using sftp process. The process always gets disconnected in between (may be after 20%) file transfer when it runs from a batch script. If i do it in interactive mode, it works.. I checked with account admin to see the timeout option if any, but didn't help.. looking for a help..
sftp
on what platform?
What version of sftp
?
FYI.
sftp
is based on ssh
and uses a configuration file to set timeouts:
SSH_CONFIG(5) BSD File Formats Manual SSH_CONFIG(5)
NAME
ssh_config -- OpenSSH SSH client configuration files
DESCRIPTION
ssh(1) obtains configuration data from the following sources in the following order:
1. command-line options
2. user's configuration file (~/.ssh/config)
3. system-wide configuration file (/etc/ssh/ssh_config)
.....
SSH_CONFIG(5) BSD File Formats Manual SSH_CONFIG(5)
...
Compression
Specifies whether to use compression. The argument must be yes or no (the default).
ConnectionAttempts
Specifies the number of tries (one per second) to make before exiting. The argument must be an
integer. This may be useful in scripts if the connection sometimes fails. The default is 1.
ConnectTimeout
Specifies the timeout (in seconds) used when connecting to the SSH server, instead of using the
default system TCP timeout. This value is used only when the target is down or really unreach-
able, not when it refuses the connection.
first install rsync
CentOS 6.4:
sudo yum install rsync
Debian/Ubuntu:
sudo apt-get install rsync
Please user rsync command and transfer file using this command
rsync -avzhe ssh public_html root@10.11.12.13:/home