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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -