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

  • Home
  • SEARCH
  • 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 9149277
In Process

The Archive Base Latest Questions

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

OS: Amazon Linux I have a Ruby script that connects to a site, then

  • 0

OS: Amazon Linux

I have a Ruby script that connects to a site, then it searches with an XPath request for a div block where is the stats counter I want to parse.

Then it compares the number from the site with the current value in the database, if the number has increased it sends me an email.

The problem is that, then I run the script from the current directory it works.

  1. The script parses the block of text which contains a value.
  2. I extract the value with Regex like this (/\d/)
    …

But when it the script executes by crontab it gets some strange value like
…041704300440043504330438044104420440043804400430432043004304304304304304404370430432043004420435043043504390447043504400435043704320430044804430430…

I don’t know how to debug it because, when I run the script manually it works, but fails with strange value when executed by crontab.

The text in the site is russian, encoded with Windows-1251.
Maybe there is something wrong with that.
I have set # encoding: utf-8, in the .rb file.

  • 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-17T11:27:20+00:00Added an answer on June 17, 2026 at 11:27 am

    That could be an environment problem, which could include bad paths, etc. You can compare your ENV from the command-line to the environment when launched by crontab.

    Try:

    ruby -rpp -e 'pp ENV' > /tmp/crontab_env.out
    

    from crontab, then:

    ruby -rpp -e 'pp ENV' > /tmp/cmd_env.out
    

    from the command-line, then:

    vimdiff /tmp/*env.out
    

    or use a regular editor.

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

Sidebar

Related Questions

I have nginx receiving POST requests and a tiny PHP script that puts request
I have developed a web service(using ruby/sinatra/sqs) which runs on Linux Red Hat. I
I have an amazon ec2 instance running on the Amazon Linux AMI and its
I have two amazon ec2 instances, (1) using SLES and running my current site,
I have trouble installing this library called librsync on an Amazon standard linux instance.
On an Amazon S3 Linux instance, I have two scripts called start_my_app and stop_my_app
I have a linux box on amazon's aws EC2. I can view the user's
I currently have a Linux, Apache, MySQL, PHP, Postfix web server that I setup
I have a website running on an Amazon EC2 Linux server, and everything works
I have setup a new Amazon Linux instance, what are the next steps 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.