How to set up a cron job to run R scripts
Category: General Information
I have recently installed R(a free statistical software) with the help of inmotion hosting support center in my vps and was trying to setup a cron job to run a R script. But it doesn't work.
If I run the same command from the command prompt it works. I have tried both the commands below but the cron job fails
cd ./path_to_R_script; R CMD BATCH script.R
cd ./path_to_R_script; Rscript script.R
If I run the same command from the command prompt it works. I have tried both the commands below but the cron job fails
cd ./path_to_R_script; R CMD BATCH script.R
cd ./path_to_R_script; Rscript script.R
OTHER ANSWERS
|
0
|
Hi somdeb, When your cron job fails, does it give you an error message? If so, please post a comment at the bottom of this page with the full error message as that will help troubleshoot what may be causing the problem. I can't say for sure if the path you're using is correct, but I would recommend trying to use the full path to your script, such as /home/userna5/path/to/script Any further details / error messages you can provide will help us quite a bit with resolving the cron that you have setup. Thanks, - Brad |
Like this Question?
Tweet
Latest Questions
If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Recent QuestionsNeed more Help?
Search
Ask the Community!
Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.
Current Customers
| Chat: | Click to Chat Now | E-mail: | support@InMotionHosting.com |
|---|---|---|---|
| Call: | 888-321-HOST (4678) | Ticket: | Submit a Support Ticket |


