knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

rschtasks

The goal of rschtasks is to make it easier to created scheduled tasks on a Windows machine in R.

Installation

You can install the development version of rschtasks from Github

remotes::install_github("jmbarbone/rschtasks")

Examples

library(rschtasks)

Create an object with the task parameters. This includes several checks to make sure the tasks are set up properly, with a few additional features.

task <- TaskScheduler$new(
  task_name  = "open notepad",
  task_run   = "notepad",
  schedule   = "once",
  start_time = "now",
  quiet      = TRUE,
  force      = TRUE
)

With the task you can run commands and see the results and calls. The task object can be reused.

task$create()
task$result
task$system_call

task$show_sid()
task$result
task$system_call

task$delete()
task$result
task$system_call

Alternatively, wrappers are provided and can be used instead.

schtasks_create(
  "open notepad",
  task_run = "notepad",
  schedule = "once",
  start_time = "asap"
)
schtasks_showsid("open notepad")
schtasks_delete("open notepad", force = TRUE)

See also

taskscheduleR, available on CRAN



jmbarbone/rschtasks documentation built on Sept. 4, 2022, 1:52 p.m.