download_with_scp: Function to download files from a remote system with 'scp'...

View source: R/download_with_scp.R

download_with_scpR Documentation

Function to download files from a remote system with scp (secure copy).

Description

download_with_scp offers an alternative to the curl based functions which can be troublesome to use with the sftp protocol on Ubuntu systems. download_with_scp needs the sshpass system programme to be installed.

Usage

download_with_scp(
  host,
  file_remote,
  file_local,
  user,
  password,
  compression = FALSE,
  verbose = FALSE,
  basename = FALSE,
  quiet_streams = FALSE
)

Arguments

host

Host name of remote system.

file_remote

A vector of remote files names to download.

file_local

A vector of file names which are the destination files for file_remote.

user

User name for scp.

password

Password for the user for scp.

compression

Should the files be copied with compression on the fly? This can speed up copying time on slower networks but not always.

verbose

Should the file to be downloaded be printed to the console as a message?

basename

If verbose, should only the basename of file being handled be printed?

quiet_streams

Should the system streams be suppressed?

Value

Invisible.

Author(s)

Stuart K. Grange

See Also

list_files_scp, sshpass, upload_with_scp

Examples

## Not run: 

# Get a file
download_with_scp(
  host = "192.1.1.1",
  file_remote = "/network_storage/r_files/sock_data.rds", 
  file_local = "~/Desktop/sock_data_copied.rds",
  user = "username",
  password = "password_for_username"
)


## End(Not run)


skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.