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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:08:14+00:00 2026-05-22T20:08:14+00:00

I have two ruby script cron jobs that I’m trying to run under Ubuntu

  • 0

I have two ruby script cron jobs that I’m trying to run under Ubuntu 10.04.2 LTS on an AWS EC2 instance. They are both failing silently – I see them being run in /var/log/syslog, but there’s no resulting files, and piping the output into a file creates no result.

The scripts are based on the ruby sql backups here:
http://pauldowman.com/2009/02/08/mysql-s3-backup/

(It’s a full backup of the db and an incremental bin-log output. Not sure that matters.)

The script works fine if run from the command line by either root or another user – it runs, and I see the files appearing in the S3 repo

I’ve tested cron with a simple “touch ~/foo” type entry and that worked fine.

My cron entry under root is this:

*/5 * * * * /home/ubuntu/mysql_s3_backup/incremental_backup.rb

Appreciate any help or debugging suggestions. My thought is that some of the ruby library dependencies might not be available when cron is running the job. But I don’t understand why I can’t seem to get any output at all returned to me. Very frustrating. Thanks.

  • 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-05-22T20:08:15+00:00Added an answer on May 22, 2026 at 8:08 pm

    The full_backup.rb script you link to contains this:

    cmd = "mysqldump --quick --single-transaction ...
    #...
    run(cmd)
    

    Notice that there is no full path on mysqldump. Cron jobs generally run with a very limited PATH in their environment and I’d guess that mysqldump isn’t in that limited PATH. You can try setting your own PATH in your crontab:

    PATH='/bin:/usr/bin:/whatever/else/you/need'
    
    */5 * * * * /home/ubuntu/mysql_s3_backup/incremental_backup.rb
    

    Or in your Ruby script:

    ENV['PATH'] = '/bin:/usr/bin:/whatever/else/you/need'
    

    Or specify the full path to mysqldump (and any other external executables) in your backup script.

    I’d go with one of the latter two options (i.e. specify ENV['PATH'] in your script or use full paths to executables) as that will reduce your dependence on external factors and these will also help avoid issues with people having their own versions of commands that you need in their PATH.

    A bit of error checking and handling on the run call might also be of use.

    If any of the necessary Ruby libraries weren’t accessible (either due to permissions or path issues) then you’d probably get complaints from the script.

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

Sidebar

Related Questions

I have a two line script that works nicely in ruby. I moved it
I have a Ruby on Rails application that has two active environments, Stage and
I have a ruby script that performs a lot of memory intensive work. The
Ruby has two different exceptions mechanisms: Throw/Catch and Raise/Rescue. Why do we have two?
I have two applications written in Java that communicate with each other using XML
I have two databases in use in a Ruby on Rails application; one is
Hello I have a very large SQL script and while trying to execute it
I have worked on two projects using Ajax and Ruby. In one project, I
I have a script that appends some rows to a table. One of the
I would like to run for example a synchronizing ruby script (in rails action

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.