whenever

WHENEVER SQLERROR never works

旧时模样 提交于 2019-12-24 00:26:25
问题 I don't know what can be a reason and I spent already hours on the Web trying to figure out what's wrong in my case. I've checked official documentation and some thought from Tom Kyte on this and surely topic on stackoverflow about it. I use following code: .. < <(sqlplus -s /nolog <<EOF set errorlogging on WHENEVER OSERROR EXIT FAILURE WHENEVER SQLERROR EXIT FAILURE connect ${use}/${pwd}@${database} @$SCRIPTS_PATH/script.sql EOF ) echo Exited with $? I've emulated different failure scenarios

Whenever Gem Fails to Run “bundle exec” Correctly in Capistrano

 ̄綄美尐妖づ 提交于 2019-12-22 10:41:06
问题 I'm having problems deploying the Whenever gem to my production environment using Capistrano. The problem is stemming from a bundle exec whenever command that's triggering some 'missing gem' issues (yet running bundle install from the shell shows that everything is in fact there!). My feeling is that one of two things is happening: that Bundler isn't fully loading before bundle exec is being called, or that somehow there's a path issue that's running it in the wrong place. Here's what's going

Is Rails's “delayed_job” for cron task really?

早过忘川 提交于 2019-12-20 10:43:12
问题 delayed_job is at http://github.com/collectiveidea/delayed_job Can delayed_job have the ability to do cron task? Such as running a script every night at 1am. Or run a script every 1 hour. If not, what are the suitable gems that can do that? And can it be monitored remotely using a browser, and have logging of success and error? 回答1: I worked on a project that tried to use DelayedJob to schedule future items. It sucked. Instead I recommend you use the whenever gem: http://github.com/javan

whenever gem have cronjob on only one machine?

孤人 提交于 2019-12-20 10:34:47
问题 We have a large deployment of around a dozen servers. We'd like to use the Whenever gem but I can't figure out a way to say which machine the cron jobs should go on! We only want these jobs to run on our server that does background jobs. Is there a way to specify this? 回答1: If you deploy the project with Capistrano and you use the default Whenever recipe, you can create a new Capistrano role role :whenever, "192.168.1.1" and set the role in your deploy.rb file set :whenever_roles, "whenever"

Sidekiq Rails 4.2 Use Active Job or Worker? What's the difference

怎甘沉沦 提交于 2019-12-20 08:40:58
问题 This is my first processing jobs asynchronously I am implementing Sidekiq for background processing in my app. I will use it for reminder emails and in-app notifications. I am confused as to whether I should use Active Job to create a job that sends an email or a Sidekiq Worker to send an email. They seem to do the same thing and Rails 4.2 Active Job seems very new…is it replacing the need for a Sidekiq Worker? Below is the same sending a mailer code using an Active Job job and a Sidekiq

whenever gem schedule.rb file: doesn't recognize RAILS_ROOT variable

╄→гoц情女王★ 提交于 2019-12-19 00:29:11
问题 In schedule.rb file, the statement: require "#{RAILS_ROOT}/config/environment.rb" every "10 10 2 * * *" do command "mysqldump -u #{@db_username} -p#{@db_password} --single-transaction #{@db_name} > #{@backup_Path}/#{@db_name}.sql 2> log/error_crontab.log" end When i try to execute the whenever cmd from terminal, getting the following error: config/schedule.rb:48:in `initialize': uninitialized constant Whenever::JobList::RAILS_ROOT (NameError) from /usr/local/lib/ruby/gems/1.9.1/gems/whenever

Rails cron whenever, bundle: command not found

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 15:28:47
问题 I am trying to use whenever to execute a rake task onces a day. Im getting this error /bin/bash: bundle: command not found /home/app/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8] (Gem::LoadError) from /home/app/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' from /home/app/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9

Rails, using whenever gem in development

雨燕双飞 提交于 2019-12-17 15:24:19
问题 Sorry quick question here from a relative Rails newbie. I'm trying to use the Whenever gem to schedule a number of rake tasks. I can't for the life of me get it to actually begin running the cron jobs on my development machine. Judging from other stackoverflow threads, it appears I should add this: set :environment, "development" to my schedule.rb file. But then what? And then how do I stop the cron jobs once they've started? Using Rails 3.2.3 in OSX UPDATE: the answer is to run $ whenever -w

How to take Auto backup of Mysql Database in Rails 4

…衆ロ難τιáo~ 提交于 2019-12-12 03:39:52
问题 I am using Rails 4 with Mysql2 as a database in Windows.I want to take auto backup of my database every second. So that there should be folder generated at every second in the path which i specify and also an email must be sent along with database as an attachment.I used whenever gem for this purpose but i am unable to get what i must write in my schedule.rb file. schedule.rb file every :day, :at => '12:05am' do rake 'task_namespace:autobackup' , :environment => 'development', :output => 'log

How may i apply sleep functionality on array in Ruby on rails

微笑、不失礼 提交于 2019-12-12 03:27:44
问题 I am working on a project in rails where i have used pluck @employees = Employee.where.not("status = ? AND strftime('%d/%m', date_of_birth) = ?", "Active" , date.strftime('%d/%m')).pluck(:email) mail(to: @employees, subject: 'Birthday Invitation') when i am sending email using Whenever gems,email is not going.I am getting Rake aborted error so how may i send email to more emp. 回答1: Try below code mailer def birthday_email date = Date.today @employees = Employee.where("status = ? AND strftime(