Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to copy more than one file to VM #41

Open
jakub-olczyk opened this issue Jun 28, 2019 · 3 comments
Open

Possibility to copy more than one file to VM #41

jakub-olczyk opened this issue Jun 28, 2019 · 3 comments

Comments

@jakub-olczyk
Copy link

Hi!

I was wondering if it would be possible to copy more than one file to the VM with this plugin. As far as I know, currently we can only copy one file at a time.

In a scenario where I want to copy more than one file I need to do that in a loop, calling vagrant scp command for each file separately. I think that maybe if we could specify more than one file the process would be slightly faster?

I know that this is possible with plain scp so why not take advantage of this ability in vagrant-scp as well? :)

I have no experience with Ruby but I think this wouldn't require a lot of work and need small changes in the parse_args method.

Cheers!

@ntkjer
Copy link

ntkjer commented Apr 2, 2020

It's possible but only by specifying a directory with multiple files. The plugin will traverse the contents of the file recursively and scp each one. So vagrant scp file1 file2 file3 targetVM:path will not work but vagrant scp dir targetVM:path will. Dir will contain file1, 2 and 3 and they'll end up in your guest VM either way :)

@jakub-olczyk
Copy link
Author

jakub-olczyk commented Apr 3, 2020

Oh, I forgot about this issue :) Thanks for a reminder @ntkjer 👍

Yeah, after looking at the source for long enough I found that it indeed does have the possibility to copy entire directories. Still after thinking about it for a bit some time I found that doing this:

$ vagrant ssh-config > conf
$ scp -F conf -r file1 file2 dir default:/vagrant

is still faster for me then downloading the plugin (I needed to have a local copy, and it was used in automation) and issuing more commands. I guess it's just my use case that this plugin isn't supporting that much. Still it was fun to figure out some of this stuff 👍

Cheers!

@ntkjer
Copy link

ntkjer commented Apr 7, 2020

for sure vanilla scp is the way to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants