WebFaction
Community site: login faq

Hey guys,

I've been trying at least 6-7 settings in schedule.rb for whenever gem, but nothing seems to actually work.

In my schedule.rb, I have this:

job_type :rake,    "cd :path && GEM_HOME=$HOME/webapps/tingls/gems RUBY_LIB=$HOME/webapps/tingls/lib PATH=$HOME/webapps/tingls/bin:$PATH rake :task"

every 30.minutes do
    rake "scrape"
end

When I do "whenever" command in putty, it gives me this:

[jinxing@web380 tingls]$ whenever
0,30 * * * * /bin/bash -l -c 'cd /home/jinxing/webapps/tingls/tingls && GEM_HOME=$HOME/webapps/tingls/gems RUBY_LIB=$HOME/webapps/tingls/lib PATH=$HOME/webapps/tingls/bin:$PATH rake scrape'

And when I run the command in the single quotes: cd /home/jinxing/webapps/tingls/tingls && GEM_HOME=$HOME/webapps/tingls/gems RUBY_LIB=$HOME/webapps/tingls/lib PATH=$HOME/webapps/tingls/bin:$PATH rake scrape

It runs rake task.

But it doesn't seem to work on its own... I don't know how to start debugging this either.

Any pointers will be welcome. Thanks guys!

asked 16 May '14, 15:30

drewzjin
1315
accept rate: 0%

edited 17 May '14, 03:51

ryans ♦♦
5.0k93260


The Whenever Gem manipulates cron, so what does the crontab look like before and after the command?

crontab -l
permanent link

answered 17 May '14, 00:12

johns
5.3k312
accept rate: 23%

edited 17 May '14, 00:13

Begin Whenever generated tasks for: /home/jinxing/webapps/tingls/tingls/config/schedule.rb

0,30 * * * * /bin/bash -l -c 'cd /home/jinxing/webapps/tingls/tingls && GEM_HOME=$HOME/webapps/tingls/gems RUBY_LIB=$HOME/webapps/tingls/lib PATH=$HOME/webapps/tingls/bin:$PATH rake scrape'

# End Whenever generated tasks for: /home/jinxing/webapps/tingls/tingls/config/schedule.rb

# Begin Whenever generated tasks for: tingls
0 * * * * /bin/bash -l -c 'cd /home/jinxing/webapps/tingls/tingls && GEM_HOME=$HOME/webapps/tingls/gems RUBYLIB=$HOME/webapps/tingls/lib PATH=$HOME/webapps/tingls/bin:$PATH rake scrape'

# End Whenever generated tasks for: tingls

It output both of these when I did crontab -l. I notice in the second one that RUBYLIB should've been RUBY_LIB. I'm quite sure how to change that up, but the first cron job should run anyway, I think.

(17 May '14, 02:44) drewzjin

Do simpler commands work? Such as this,

/bin/date +"%T" >> /home/$USER/test.log

Which should print the time in a file named 'test.log'

(17 May '14, 23:34) johns
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×108
×17
×6
×1

question asked: 16 May '14, 15:30

question was seen: 2,181 times

last updated: 17 May '14, 23:35

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM