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 9120041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:32:27+00:00 2026-06-17T05:32:27+00:00

I have a ruby script I want to execute every 10 minutes that I

  • 0

I have a ruby script I want to execute every 10 minutes that I had working previously, but I lost my script and I’m trying to rewrite it and can’t get it to work. The cron settings I left unchanged from when it did work, but here’s what I have.

rvm_bin_path=/home/usr/.rvm/bin
GEM_HOME=/home/usr/.rvm/gems/ruby-1.9.3-p194
SHELL=/bin/bash
IRBRC=/home/usr/.rvm/rubies/ruby-1.9.3-p194/.irbrc
MY_RUBY_HOME=/home/usr/.rvm/rubies/ruby-1.9.3-p194
__array_start=0
rvm_path=/home/usr/.rvm
escape_flag=1
rvm_prefix=/home/usr
PATH=/home/usr/.rvm/gems/ruby-1.9.3-p194/bin:/home/usr/.rvm/gems/ruby-1.9.3-p194@global/bin:/home/usr/.rvm/rubies/ruby-1.9.3-p$
PWD=/etc
LANG=en_CA.UTF-8
_second=1
rvm_version=1.14.1 (stable)
_first=0
GEM_PATH=/home/usr/.rvm/gems/ruby-1.9.3-p194:/home/usr/.rvm/gems/ruby-1.9.3-p194@global
RUBY_VERSION=ruby-1.9.3-p194
_=/usr/bin/env

*/10    *       *       *       *       bash -li -c /home/usr/MeetCal-bot/run-bot.sh

I’m running cron as su, which is why I needed to add all those environment variables, to ensure it has everything it needs to run ruby. I had it working previously with all that same information, so I don’t think I’m missing anything

The bash script I have is this:

#!/bin/bash
ruby /home/usr/bot/bot.rb >> /home/usr/bot/output.txt

When the job runs, it makes output.txt, except it’s empty, and I would expect there to be some output, maybe a ruby error message.

I did chmod 777 * for the directory as a last resort, to try to fix any permissions issues, but that didn’t help.

If I run the ruby script as my local user, it runs fine without any errors, but I can’t seem to figure out why it works running as my user, but not as su.

  • 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-17T05:32:28+00:00Added an answer on June 17, 2026 at 5:32 am

    I would leave out -i and -c, since those aren’t necessary. Just do

    */10 * * * * bash -l /home/usr/MeetCal-bot/run-bot.sh
    

    for a start.

    In your script, insert a which ruby >>/home/usr/bot/output.txt to see, if it finds ruby at all. And to see any error messages, add 2>&1 to your ruby invocation

    #!/bin/bash
    
    which ruby >>/home/usr/bot/output.txt
    ruby /home/usr/bot/bot.rb >>/home/usr/bot/output.txt 2>&1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created one ruby script that I want to run with some flags
I have a Ruby script that generates an ANSI file. I want to convert
I have a thor-based Ruby script, but I want to deploy it as a
I have a Ruby 1.9 script that I want to run as a long-running
I have a ruby script that I want to run 24/7 on my vps(
I have a Ruby script that crawls a site, and takes 40 minutes. What
Well, the title say it all. I have a ruby script I want running
I have Ruby script that creates a proxy so that I can make HTTP
so i have ruby script that simply writes to a test.txt file with hello
I have a ruby script that opens a browser. I have it set to

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.