initSSH: Initiate SSH

Description Usage Arguments Details Value

View source: R/remoteFunction.R

Description

Initiates the SSH connection and returns an object to define and execute functions remotely

Usage

1
2
3
4
5
initSSH(login, password = NULL, pwfile = NULL, port = 22,
  PS1 = "remFunPrompt>>>", regexPS1 = NULL, tempdir.loc = NULL,
  tempdir.rem = NULL, Rscript = NULL, timeout.con = 20,
  timeout.cmd = 20, verbosity = 1, delay = c(1, 1, 1, 5, 5, 5),
  delay2 = delay * 1.5, use.exist = TRUE)

Arguments

login

login in the form user@host

password

password for the ssh connection

pwfile

file whose first line contains password (overrides password)

tempdir.loc

directory on local machine to store files

tempdir.rem

directory on remote machine to store files

Rscript

path to the Rscript executable on the remote machine

timeout.con

duration after which a connection attempt is considered as timed out

timeout.cmd

duration after which a bash command is considered timed out

verbosity

verbosity of the status messages

delay

waiting time between connection attempts (lower limit)

delay2

waiting time between connection attempts (upper limit)

use.exist

should functions and results already available in tempdir.loc be used

Details

The returned list contains the following functions:

createRemoteFunction(fun, fun.name=NULL, cache=TRUE, transfer=TRUE, timeout=NULL, show.output=TRUE) Defines a function fun with name fun.name. Returns a function with the same arguments as fun that remotely evaluates fun. The flag cache determines whether inputs and results should be cached on the local machine. The maximal allowed duration of execution in seconds is specified by timeout. The flag show.output determines whether output to stdout on remote machine should be mirrored on the local machine. If transfer=FALSE, the function is not uploaded automatically and function updateAndTransfer has to be called before execution.
updateAndTransfer Batch uploads all functions created by createRemoteFunction. If the directory tempdir.loc was also used in previous sessions, then also functions defined in these previous sessions will be uploaded.
uploadPackage(package) Uploads a package to the remote machine
removePackage(package) Removes an uploaded package from the remote machine
uploadGlobalSource(text=NULL,file=NULL) Uploads R code either given as file or as character string that is sourced before every function execution. If both text and file are specified, text will be used.
uploadGlobal(...) Uploads objects to the remote machine. Syntax is the same as for save.
removeGlobal() Remove all global objects and sources from the remote machine.
getFun(name) returns the source code of the function with the specified name
listFuns() returns a character vector with the names of all registered functions.
execFun(name) returns the function wrapper to execute the respective function remotely. If fun(arg1, arg2, ...), then the function can be called by execFun("fun")(arg1,arg2,...)
getFunDataDir(name) returns the data directory of the function named name on the local machine
getRemFunDataDir(name) returns the data directory of the function named name on the remote machine
uploadFunData(name,files=NULL) uploads files from the local to the remote data directory
downloadFunData(name,files=NULL) downloads files from the remote to the local data directory
clearFunData(name,files=NULL,del.rem=TRUE, del.loc=TRUE) deletes data from the local and/or remote machine
closeCon() Closes the connection and cleans up files (but does not delete functions and their inputs and outputs)

The result list contains beside these functions also the objects ssh and rsync. These objects are the result of calls to initInteractiveSSH and initRsync of the packages interactiveSSH and rsyncFacility.

Value

A list with functions to define and execute R functions, see details.


gschnabel/remoteFunctionSSH documentation built on Sept. 1, 2020, 8:41 p.m.