bnosac / taskscheduleR

Schedule R scripts/processes with the Windows task scheduler.
330 stars 72 forks source link

Scheduling weekly jobs on specific days #11

Closed ckhjoe closed 8 years ago

ckhjoe commented 8 years ago

Hi there

apologies if this seems really obvious. Is there a way we could specify days for the weekly tasks in the in the coding side or the interface?

Thanks, J

jwijffels commented 8 years ago

in the interface, select weekly and 1 day where to start, this will launch it every week at that day starting from that day or use the days argument in taskscheduler_create

ckhjoe commented 8 years ago

Thanks for the response. I would like make it run 3 days of that week. Is that possible?

Thanks

Sent from my iPhone

On 24 Jun 2016, at 11:28 PM, jwijffels notifications@github.com wrote:

in the interface, select weekly and 1 day where to start, this will launch it every week at that day starting from that day or use the days argument in taskscheduler_create

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jwijffels commented 8 years ago

Use the addin and select 3 days or use the functions from the package:

myscript <- system.file("extdata", "helloworld.R", package = "taskscheduleR")
runon <- format(Sys.time() + 62, "%H:%M")

taskscheduler_create(taskname = "myfancyscript_sun", rscript = myscript, 
                     schedule = "WEEKLY", starttime = runon, days = 'SUN')
taskscheduler_create(taskname = "myfancyscript_tue", rscript = myscript, 
                     schedule = "WEEKLY", starttime = runon, days = 'TUE')
taskscheduler_create(taskname = "myfancyscript_thu", rscript = myscript, 
                     schedule = "WEEKLY", starttime = runon, days = 'THU')

alltasks <- taskscheduler_ls()
subset(alltasks, TaskName %in% c("myfancyscript_sun", "myfancyscript_sun", "myfancyscript_thu"))
taskscheduler_delete(taskname = "myfancyscript_sun")
taskscheduler_delete(taskname = "myfancyscript_tue")
taskscheduler_delete(taskname = "myfancyscript_thu")
ckhjoe commented 8 years ago

Thank you I will try later. Sorry I'm new to R 😩

Sent from my iPad

On 25 Jun 2016, at 1:10 AM, jwijffels notifications@github.com wrote:

Use the addin and select 3 days or use the function:

taskscheduler_create(taskname = "myfancyscript_sun", rscript = myscript, schedule = "WEEKLY", starttime = runon, days = 'SUN') taskscheduler_create(taskname = "myfancyscript_tue", rscript = myscript, schedule = "WEEKLY", starttime = runon, days = 'TUE') taskscheduler_create(taskname = "myfancyscript_thu", rscript = myscript, schedule = "WEEKLY", starttime = runon, days = 'THU')

alltasks <- taskscheduler_ls() subset(alltasks, TaskName %in% c("myfancyscript_sun", "myfancyscript_sun", "myfancyscript_thu")) taskscheduler_delete(taskname = "myfancyscript_sun") taskscheduler_delete(taskname = "myfancyscript_tue") taskscheduler_delete(taskname = "myfancyscript_thu") — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.