installr (version 0.21.0)

kill_process: kill (i.e.: stop) running processes by there process name

Description

kill (i.e.: stop) running processes by there process name It spawns a new Rscript which runs pskill on the pid-s per process name.

Usage

kill_process(process, s = 0, m = 0, h = 0, exact = FALSE, ...)

Arguments

process

a character vector of process names.

s

numeric. number of seconds to wait before killing the processes

m

numeric. number of minutes to wait before killing the processes

h

numeric. number of hours to wait before killing the processes

exact

logical (FALSE). should we get exact match to process name, or can we use just partial matching.

...

not used.

Value

output from system

References

tasklist details from microsoft homepage: http://technet.microsoft.com/en-us/library/bb491010.aspx pskill details from microsoft homepage: http://technet.microsoft.com/en-us/sysinternals/bb896683.aspx

See Also

get_tasklist, get_Rscript_PID, get_pid, kill_pid, kill_all_Rscript_s, pskill

Examples

Run this code
# NOT RUN {
# create several running processes of Rscript (to shitdown)
system("Rscript -e repeat{2+2}", wait = FALSE) # this process should be stuck   
system("Rscript -e repeat{2+2}", wait = FALSE) # this process should be stuck   
# here are there pid numbers:
get_Rscript_PID() 
# let's kill them:
kill_process("Rscript")
# they are gone...
get_Rscript_PID() # we no longer have Rscripts running
# }

Run the code above in your browser using DataCamp Workspace