Closed pinkumbrella14 closed 4 years ago
Delete it first with taskscheduler_delete, next recreate it with taskscheduler_create. If your stuck, just go to the Windows Task scheduler and delete it there.
@jwijffels thanks. Honestly, I just realized that I didn't log in to RStudio as an administrator, which is why it wasn't giving me permission to change an existing task. Sorry, I'll close this issue! (Would delete it if I could).
I had scheduled a recurring daily task with taskcheduler_create, which was running dialy; however, my compter was restarted due to updates and I am now encountering an issue trying to reset this task.
Here is my code, which before the restart worked without issues:
When I run this script now, I get the following warning and the task will not run: [1] "WARNING: The task name \"IA_run_daily\" already exists. Do you want to replace it (Y/N)? " attr(,"status") [1] 1 Warning message: In system(cmd, intern = TRUE) : running command 'schtasks /Create /TN "IA_run_daily" /TR "cmd /c C:/Users/XXXX/AppData/Local/CONTIN~1/ANACON~1/lib/R/bin/Rscript.exe \"C:/Users/XXXX/Documents/task_scheduler_rscripts/forecast_IA_final.R\" >> \"C:/Users/XXXX/Documents/task_scheduler_rscripts/forecast_IA_final.log\" 2>&1" /SC DAILY /ST 09:50 /SD "12/12/2019" ' had status 1
I am not sure how to tell R that yes, I was to replace the previous "IA_run_daily" task with the current one I am trying to schedule. If I type "Y" into the console, I get an error "object not found". Would appreciate any thoughts on this!