Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

R taskscheduleR not executing script

$
0
0

I'm trying to run a script once every minute using taskscheduleR library. I'm following the examples from the GitHub page but am runing into the following problems:

  1. R says task created but the script does not execute properly (it should write data to a file in append mode - the file in question already exists)
  2. I do not see any log files - I believe they should be stored in the same location as the script being executed
  3. Deleting the task using taskscheduler_delete("rds_task") does not work

Here's my code:

taskscheduler_create(taskname = "rds_task", 
                     rscript = "./Testing_Scheduler/testing_scheduler.R",
                     schedule = "MINUTE", 
                     starttime = format(Sys.time() + 30, "%H:%M"), 
                     startdate = format(Sys.time(), "%d/%m/%Y"),
                     modifier = 1)

And the contents of testing_scheduler.R:

dat <- mtcars
data.table::fwrite(dat[1, ], "./Testing_Scheduler/testfile.txt", append = T)

To delete the task, I used:

taskscheduler_delete("rds_task")

which was unsuccessful. I ended up using the Windows Task Scheduler (my computer is in French - can't change that, sorry):

Deleting task in Windows Task Scheduler

Same result with the R add-in except that I seem to be able to delete the task that way. I have admin rights on my computer (so it should not be an access-related problem).

Any help is appreciated!


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>