Skip to content

Commit

Permalink
rename taskcheduler_runnow to taskscheduler_runnow and taskcheduler_s…
Browse files Browse the repository at this point in the history
…top to taskscheduler_stop
  • Loading branch information
jwijffels committed Oct 24, 2018
1 parent 7be42cb commit e84c483
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 18 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Description: Schedule R scripts/processes with the Windows task scheduler. This
Authors@R: c(person("Jan", "Wijffels", role = c("aut", "cre", "cph"), email = "[email protected]"), person("BNOSAC", role = "cph"), person("Oliver", "Belmans", role = c("cph", "aut")))
Maintainer: Jan Wijffels <[email protected]>
License: AGPL-3
Version: 1.3
Version: 1.4
URL: https://github.com/bnosac/taskscheduleR
OS_type: windows
Date: 2018-09-01
Date: 2018-10-24
Imports:
data.table,
tools,
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export(taskschedulerAddin)
export(taskscheduler_create)
export(taskscheduler_delete)
export(taskscheduler_ls)
export(taskscheduler_runnow)
export(taskscheduler_stop)
importFrom(data.table,fread)
importFrom(data.table,setDF)
importFrom(tools,file_path_sans_ext)
Expand Down
29 changes: 21 additions & 8 deletions R/taskscheduleR.R
Original file line number Diff line number Diff line change
Expand Up @@ -203,21 +203,23 @@ taskscheduler_delete <- function(taskname){
#'
#' @param taskname the name of the task to run. See the example.
#' @return the system call to schtasks /Run
#' @export
#' @export taskscheduler_runnow
#' @export taskcheduler_runnow
#' @aliases taskcheduler_runnow
#' @examples
#' \dontrun{
#' myscript <- system.file("extdata", "helloworld.R", package = "taskscheduleR")
#' taskscheduler_create(taskname = "myfancyscript", rscript = myscript,
#' schedule = "ONCE", starttime = format(Sys.time() + 10*60, "%H:%M"))
#'
#' taskcheduler_runnow("myfancyscript")
#' taskscheduler_runnow("myfancyscript")
#' Sys.sleep(5)
#' taskcheduler_stop("myfancyscript")
#' taskscheduler_stop("myfancyscript")
#'
#'
#' taskscheduler_delete(taskname = "myfancyscript")
#' }
taskcheduler_runnow <- function(taskname){
taskscheduler_runnow <- function(taskname){
cmd <- sprintf('schtasks /Run /TN %s', shQuote(taskname, type = "cmd"))
system(cmd, intern = FALSE)
}
Expand All @@ -228,23 +230,34 @@ taskcheduler_runnow <- function(taskname){
#'
#' @param taskname the name of the task to stop. See the example.
#' @return the system call to schtasks /End
#' @export
#' @export taskscheduler_stop
#' @export taskcheduler_stop
#' @aliases taskcheduler_stop
#' @examples
#' \dontrun{
#' myscript <- system.file("extdata", "helloworld.R", package = "taskscheduleR")
#' taskscheduler_create(taskname = "myfancyscript", rscript = myscript,
#' schedule = "ONCE", starttime = format(Sys.time() + 10*60, "%H:%M"))
#'
#' taskcheduler_runnow("myfancyscript")
#' taskscheduler_runnow("myfancyscript")
#' Sys.sleep(5)
#' taskcheduler_stop("myfancyscript")
#' taskscheduler_stop("myfancyscript")
#'
#'
#' taskscheduler_delete(taskname = "myfancyscript")
#' }
taskcheduler_stop <- function(taskname){
taskscheduler_stop <- function(taskname){
cmd <- sprintf('schtasks /End /TN %s', shQuote(taskname, type = "cmd"))
system(cmd, intern = FALSE)
}


taskcheduler_stop <- function(taskname){
.Deprecated("taskscheduler_stop", msg = "Use taskscheduler_stop instead of taskcheduler_stop")
taskscheduler_stop(taskname)
}

taskcheduler_runnow <- function(taskname){
.Deprecated("taskscheduler_stop", msg = "Use taskscheduler_runnow instead of taskcheduler_runnow")
taskscheduler_runnow(taskname)
}
3 changes: 3 additions & 0 deletions inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Package: taskscheduleR
================

Version: 1.4 [2018-10-24]
- Rename taskcheduler_stop to taskscheduler_stop and taskcheduler_runnow to taskscheduler_runnow

Version: 1.3 [2018-09-11]
- Change codepage to UTF-8 (using chcp 65001) in taskscheduler_ls

Expand Down
9 changes: 5 additions & 4 deletions man/taskcheduler_runnow.Rd → man/taskscheduler_runnow.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions man/taskcheduler_stop.Rd → man/taskscheduler_stop.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e84c483

Please sign in to comment.