I would like to run a script every 30 min from my local comp. Most of the time I am away from my desk. I do not want to run my computer all day. What would be some ways to do this.
Currently I have the following code. The code works perfectly while my computer is running.
library(taskscheduleR)
taskscheduler_create("docu",
"C:/Users/jorda/OneDrive/Documents/first.R",
"MINUTE", "23:15", modifier = 30, startdate = "2019/06/05")
Note* I am using windows 10.
The ideal solution would be for the computer to wake up to run the code and then go back to sleep.
I am using this video for guidance https://www.youtube.com/watch?v=UDKy5_SQy2o&t=213s
I have a folder called task which currently holds 2 children: firstschedule.R and task1.bat. My .bat file is:
@echo off
R CMD BATCH #path to my file
When I try to open the file I get a pop up that says - Run as administrator or another user. After clicking run as administrator, I get another pop up that asks me if windows can make changes to my computer. After clicking allow. Nothing happens. I was expecting an output log to pop up with all the outputs. My R script is simple
x=10
y = x + 5
print(y)
here is a similar more up to date tutorial. https://www.r-bloggers.com/how-to-run-r-from-the-task-scheduler/ It seems I am having a hard time locating this Rscript file. Is it something that was used in older versions of R but not for the current 3.6.0?