diff --git a/DESCRIPTION b/DESCRIPTION index e74c32c..1b5070d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 = "jwijffels@bnosac.be"), person("BNOSAC", role = "cph"), person("Oliver", "Belmans", role = c("cph", "aut"))) Maintainer: Jan Wijffels License: AGPL-3 -Version: 1.5 +Version: 1.6 URL: https://github.com/bnosac/taskscheduleR OS_type: windows Imports: diff --git a/R/taskscheduleR.R b/R/taskscheduleR.R index a2195cb..0f6b1e8 100644 --- a/R/taskscheduleR.R +++ b/R/taskscheduleR.R @@ -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) diff --git a/inst/NEWS b/inst/NEWS index 302ac45..cae5eb6 100644 --- a/inst/NEWS +++ b/inst/NEWS @@ -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