Learn R Programming

ssh.utils (version 1.0)

ps.grep.remote: Checks for processes running on a local or remote machine.

Description

One of the use cases for this function is to ensure that an R process is already running and not start another one accidentally.

Usage

ps.grep.remote(grep.string, remote, stop.if.any = FALSE, stop.if.none = FALSE, count.self = FALSE, ps.options = "aux")

Arguments

grep.string
String(s) to check for in ps. If a vector, runs a chain of piped grep commands for each string.
remote
Remote machine specification for ssh, in format such as user@server that does not require interactive password entry. For local execution, pass an empty string "" (default).
stop.if.any
Stop if any of grep.string is running
stop.if.none
Stop if none of grep.string is running
count.self
When FALSE, excludes the calling process name from the count, if it gets matched.
ps.options
Gives the ability to run different options to ps.

See Also

run.remote

Examples

Run this code
## Not run: 
# # Check if Eclipse is running.
# ps.grep.remote("Eclipse", remote = "")
# # [1] TRUE
# ## End(Not run)

Run the code above in your browser using DataLab