Skip to content

Commit

Permalink
issue #88 schedule once in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijffels committed Mar 10, 2022
1 parent ea6ebee commit c625787
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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.5
Version: 1.6
URL: https://github.com/bnosac/taskscheduleR
OS_type: windows
Imports:
Expand Down
10 changes: 8 additions & 2 deletions R/taskscheduleR.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,14 @@ taskscheduler_create <- function(taskname = basename(rscript),
if(!schedule %in% c('ONLOGON', 'ONIDLE')){
cmd <- sprintf("%s /ST %s", cmd, starttime)
}
if(!schedule %in% c('ONCE', 'ONLOGON', 'ONIDLE')){
cmd <- sprintf("%s /SD %s", cmd, shQuote(startdate))
if(!schedule %in% c('ONLOGON', 'ONIDLE')){
if(schedule %in% "ONCE" && missing(startdate)){
## run once now
cmd <- cmd
}else{
cmd <- sprintf("%s /SD %s", cmd, shQuote(startdate))
}

}
if(schedule %in% c('WEEKLY', 'MONTHLY')){
cmd <- sprintf("%s /D %s", cmd, days)
Expand Down
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.6 [2022-03-10]
- Use startdate in case of schedule = 'ONCE' in order to allow scheduling a script to run once in the future (issue #88)

Version: 1.5 [2021-04-16]
- Add rmarkdown to Suggests in DESCRIPTION

Expand Down

0 comments on commit c625787

Please sign in to comment.