Capistrano: uploading / downloading directory to / from remote server via SCP or sftp

Published on Author Akhil Bansal2 Comments

Hey I found two interesting functions while going through capistrano’s files. There are two functions named “upload” and “download”, which can be used to download and upload directories from / to remote server using scp.

Examples:

[source: ruby]
upload(“LOCAL_DIR_PATH”, “REMOTE_PATH”, :via=> :scp, :recursive => true)
[/source] [source: ruby]
download(“REMOTE_PATH”, “LOCAL_DIR_PATH”, :via=> :scp, :recursive => true)
[/source]

You can also use :sftp.

Unfortunately it is not much documented 🙁 .

2 Responses to Capistrano: uploading / downloading directory to / from remote server via SCP or sftp

Leave a Reply

Your email address will not be published. Required fields are marked *