Scheduling R Script using Windows Task Scheduler

Scheduling R Script using Windows Task Scheduler

Folks,

In this blog we will learn how to schedule R Script using Windows Task Scheduler!


Suppose here is the R Script which we want to schedule.

Output of this script: Create a log file of name “R_Scripts_Logs_<Time stamp>.TXT” & having text “Script successfully invoked by scheduler at <Time stamp>” .

1

Create a batch file having below commands:

@echo off
“Location of R.exe” CMD BATCH “Location of R Script”

Example: 

2.png


Steps for scheduling R Script using Windows Task Scheduler:

Open Window Task Scheduler & Create Basic Task

3

Step 1: Provide your task name & description.step-1

Step 2: Provide trigger timings details as per your requirement.

step-2

step-3

Step 3: In Action:- provide the location of the batch file of the script. After that save the task.

step-5step-6

Task has been scheduled.

step8

At 22:05, task triggered the batch file automatically.

Here is the output of that script:

outut

When you run R script using CMD Batch, one ROUT file also generated automatically having details of script commands & time elapsed of script.

Below is ROUT fie of the script my R Script.R

output


Thanks!

Happy Learning! Your feedback would be appreciated!

Advertisements