Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7790485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:36:03+00:00 2026-06-01T21:36:03+00:00

I am trying to schedule my R script using cron, but it is not

  • 0

I am trying to schedule my R script using cron, but it is not working. It seems R can not find packages in cron. Anyone can help me? Thanks.

The following is my bash script

# source  my profile
. /home/winie/.profile
# script.R will load packages
R CMD BATCH /home/script.R 

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:36:06+00:00Added an answer on June 1, 2026 at 9:36 pm

    Consider these tips

    1. Use Rscript (or littler) rather than R CMD BATCH

    2. Make sure the cron job is running as you

    3. Make sure the script runs by itself

    4. Test it a few times in verbose mode

    My box is running the somewhat visible CRANberries via a cronjob calling an R script
    (which I execute via littler but Rscript
    should work just as well). For this, the entry in /etc/crontab on my Ubuntu server is

    # every few hours, run cranberries
    16 */3 * * *    edd     cd /home/edd/cranberries && ./cranberries.r
    

    so every sixteen minutes past every third hour, a shell command is being run with my id. It changes into the working directory, and call the R script (which has executable modes etc).

    Looking at this, I could actually just run the script and have setwd() command in it….

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write parsing script using python/scrapy. How can I remove [] and
I'm trying to run this script from the cron job schedule on Ubuntu Linux
I'm trying to schedule a job in oracle 10g but it says: ORA-01846: not
I am trying to schedule the tasks from my application using schtasks instead of
I'm trying to schedule a long T-SQL script. However, the script gets cut off
I was trying to setup a cron to run a php script on my
I am trying to schedule a timer using the timertask. I want to freeze
I am trying to schedule a function call for a sequence of items using
I'm using SQL Server 2008 and trying to make schedule to run a page
I am trying to update SQL Server Agent schedules using msdb.dbo.sp_update_schedule , but when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.