upload_with_scp: Function to upload files locally to a remote system with...

View source: R/download_with_scp.R

upload_with_scpR Documentation

Function to upload files locally to a remote system with scp (secure copy).

Description

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

Usage

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

Arguments

host

Host name of remote system.

file_local

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

file_remote

A vector of remote files names to download.

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 uploaded 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, download_with_scp

Examples

## Not run: 

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


## End(Not run)


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