Windows Server scheduled task (R script) fails - log not informative

1

I'm trying to schedule an R script to run weekly via Windows Server 2008 task scheduler.

Originally I set up the task via taskscheduleR like so:

library(taskscheduleR)
taskscheduler_create(taskname = "twitter_scrape",
                     rscript = "T:\\HackR\\Folder\\web_sna\\code\\twitter_scheduled.R",
                     startdate = format(Sys.Date(), "%m/%d/%Y"),
                     schedule = "WEEKLY")

The task failed with an error code of 0xc000013a. When clicking the task's Properties then viewing the History tab, the events indicate that it completed successfully, however it actually did not, as the return status code implies.

Following various troubleshooting material I found online, I tried changing several options, including

  • Enabling "run whether user is logged on or not" in combination with "run with highest privileges"
  • Adding the script's parent directory to the optional "Start in" field

The only effect of those options on the outcome was changing the error code (Last Return Result) to 0x1.

The external log file created by the task reads as follows:

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.3/twitteR_1.1.9.zip'
Content type 'application/zip' length 446306 bytes (435 KB)
==================================================
downloaded 435 KB

package 'twitteR' successfully unpacked and MD5 sums checked

The downloaded binary packages are in
  F:\temp\RtmpasZDYO\downloaded_packages

twitteR installed
^C

Of course, the script runs fine when run manually.

r
scheduled-tasks
windows-server
asked on Stack Overflow Jan 19, 2017 by Hack-R

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0