I run an R script which contains SQL query and import the .csv file and mail it to the manager and operations daily. But I am looking forward to automating this process so kindly help me with the steps I should do to automate.
The .csv file has the day stamp.
mydb = dbConnect(MySQL(), user='*******', password='******', dbname='********', host='*****8***')
setwd('C:\\Users\\******\\Work\\2. ****\\26. Cluster_Bags')
#Change the data here
startdate='2017-07-24'
sql_text=paste("SELECT ********************************,
FROM ********************
WHERE ***********
")
ClusterwiseBag=dbGetQuery(mydb,sql_text)
#Creates a file with the name "Clusterbag date.csv"
b=paste("Clusterbag",startdate,".csv",sep="")
write.csv(ClusterwiseBag,b)