I would like to get large file over sftp. I execute following commands:

kopparberg:dev marek$ sftp -P 678 marek@server
marek@server's password: 
Connected to server.
sftp> cd backup
sftp> get database.gz /Volumes/www/backup/
Fetching /backup/database.gz to /Volumes/www/backup/database.gz
                                                  9%   44MB   1.4MB/s   05:06 ETA

Because it follows some more commands, I decided to write a bash script and I put sftp commands in batchfile.

Bash file looks like this:


#get backup file
sftp -P 678 -o "BatchMode no" -b batchfile.sftp marek@server

#following commands

In bacthfile.sftp are just three steps:

cd backup
get database.gz /Volumes/www/backup/

The problem is that I do not see progress when I run the bash file. Is there any rational explanation behind?

2 Answers 2


Why don't you just use a single SCP command instead?

scp -P 678 marek@server:/backup/database.gz /Volumes/www/backup/

I also believe that using this method will give you the desired output evern when run from a script.


rsync over sftp will do that for you, no scripting required:

rsync -av --progress -e 'ssh -p 678' marek@server:backup/database.gz /Volumes/www/backup/
  • Note that this requires rsync to be installed on both machines. Dec 2, 2012 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.