braintree / runbook

A framework for gradual system automation
MIT License
734 stars 43 forks source link

feature: download directory #21

Closed fwolfst closed 4 years ago

fwolfst commented 4 years ago

Currently download will nicely scp a file. However, directories are not supported (scp -r). A download_dir statement would be helpful and avoid command "scp -r" or capture %Q{scp -r} calls.

fwolfst commented 4 years ago

SSHKit does have a recursive flag for uploads, i do not see documentation about a recursive download.

pblesi commented 4 years ago

I tested this and it does work for downloads as well when executing against a remote server:

download "/etc/network", to: ".", options: {recursive: true}

I did encounter some finickiness with actually downloading a large number of files due to some prematurely closed stream error that I did not look into further.

This does not work for executing against the localhost as it appears this feature wasn't added to SSHKit: https://github.com/capistrano/sshkit/blob/6af6cade88894c7cba20d5b68c9cf752bd3702b1/lib/sshkit/backends/local.rb#L13-L37

In any case, any issues related to recursive downloads and uploads should probably be handled upstream, so I'm going to close this issue.