Created
May 16, 2019 22:09
-
-
Save dwhdai/0ecca8cb8d9492a267b4c1d27e8ca4c9 to your computer and use it in GitHub Desktop.
Schedule an R script to run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to script that should be sourced | |
rscript <- "path_to_script/script_name.R" | |
# To create the task | |
taskscheduleR::taskscheduler_create(taskname = basename(rscript), | |
rscript = rscript, | |
schedule = c("DAILY"), # Set schedule frequency | |
starttime = "08:00", # Set schedule start time | |
startdate = format(as.Date("2019-04-26"), "%m/%d/%Y") # Set schedule start date | |
) | |
# To delete the task | |
taskscheduleR::taskscheduler_delete("script_name.R") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment