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

Description Usage Arguments Note See Also Examples

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

1
2
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.

Note

This may not work on Windows.

See Also

run.remote

Examples

1
2
3
4
5
6
## Not run: 
# Check if Eclipse is running.
ps.grep.remote("Eclipse", remote = "")
# [1] TRUE

## End(Not run)


Search within the ssh.utils package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.