How to set up a cron job to run R scripts


somdeb
Asked:
2012-03-01 2:20 pm EST

Hits: 3,061
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

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

BradM
Staff
5,399 Points
2012-03-01 2:26 pm EST
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

You must login before you can post a comment about this answer.

Like this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need 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

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!