How to automate retry on an R script in PowerShell when the connection breaks -


i have code powershell runs r script. script supposed scraping twitter. unfortunately, connection twitter breaking down, , have manually re-run script. possible run script automatically once twitter connection breaks not have sit , monitor it?

following powershell code.

cd c:\program` files\r\r-3.2.0\bin  get-content c:\users\lab-user\documents\sentiment_twitter\trial.r | .\r.exe --save 

it easier create loop. if connections breaks loop start on again. create batch file. , enter following

@echo off cls :start powershell.exe -command "get-content c:\users\samarth\documents\twitter\trial.r | c:\program` files\r\r- 3.2.0\bin\r.exe --save" goto start 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -