-
Notifications
You must be signed in to change notification settings - Fork 225
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
download_file()
improvements
#3331
Comments
Wrt downloading multiple files from a host in one ssh session. I've just managed to use run_command("echo \"${batchfile}\" | sftp -b- ${target.user}@{$target.uri}", 'localhost') |
I'd also love to be able to download multiple files in one command. We use oscap to generate a report file and a results file per target and currently I need to call And since those files are text files in my case, could we also introduce a flag to compress it during transport (if not already handled in some way)? This brings me to a next idea: Can we have a Example:
(consider case if multiple targets are set, maybe theres a variable we can use in $cmd_receive) |
Hit this today again.. so far I can say that the only good use-case is when you want to download one file/one directory from bunch of hosts once. For anything else it's easier to script rsync or sftp directly. P.S. As a consequence I need |
Use Case
The existing approach with storing a file downloaded to the
$destination
directory under thebasename($source)
file name is quite limiting.. Downloading bunch of files from a host or downloading files with the same name but different path from a host makes it especially painful.Describe the Solution You Would Like
download_file()
accepts an Array as a source. This way we can download bunch of files with one call. That opens another question how to download a bunch of files within one transport connection, but it's another question.$destination
a dynamic template, which can accept the source file name and a host name as a parameters. For example:Side notes
download_file
shouldn't be destructive #3198 also. No real reason to wipe the target directory I guess.download_file()
(download_files()
)?. Though, there is no breaking change as long as template processing is requested explicitly in the$options
.The text was updated successfully, but these errors were encountered: