LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-13-2017, 07:23 AM   #1
visuharsha
LQ Newbie
 
Registered: Jul 2017
Posts: 13

Rep: Reputation: Disabled
Crontab issue with the Redmine application


Good evening,

I've configured a redmine 3.0 application in our environment, everything went successful and we started using the environment

I've configured the issues_reminder plugin which generates all the issues and will send to a particular mail id if configured in the dashboard, for that a crontab is needed to be implemented, i've written a script for that

the script is :

source /home/centos/.rvm/environments/ruby-2.2.5@global

cd /var/www/redmine
/home/centos/.rvm/gems/ruby-2.2.5/bin/rake reminder:exec RAILS_ENV="production"

when the script is running without crontab i'm getting the process done without errors, but if i run the same script using the crontab i'm getting the error as

" rake aborted!
LoadError: cannot load such file -- bundler/setup
/var/www/redmine/config/boot.rb:4:in `<top (required)>'
/var/www/redmine/config/application.rb:1:in `<top (required)>'
/var/www/redmine/Rakefile:5:in `<top (required)>'
/home/centos/.rvm/gems/ruby-2.2.5@global/bin/ruby_executable_hooks:15:in `eval'
/home/centos/.rvm/gems/ruby-2.2.5@global/bin/ruby_executable_hooks:15:in `<main>' "

please help me, i'm working on it from long time
 
Old 11-13-2017, 08:39 AM   #2
linom
Member
 
Registered: May 2015
Location: India
Distribution: Debian, CentOS,Redhat, Fedora, Ubuntu
Posts: 91

Rep: Reputation: 13
Probably you need to execute this script in root user mode in the cron job. also i feel you need to set the envirionment variable for Loading bundler/setup or define the entire path.
 
Old 11-15-2017, 10:15 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
For Comparison...

# Redmine 7day reminders...
Code:
00 09 * * Mon /var/www/html/extra/issue_reminders.sh > /dev/null 2>&1
issue_reminders.sh
Code:
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cd /var/www/html/; /usr/bin/bundle exec rake redmine:send_reminders days=7 RAILS_ENV="production"
Running redmine 3.20 on Ubuntu 14.04.5 LTS

Your path to the rake exec looks "off", that is
Code:
/home/centos/.rvm/gems/ruby-2.2.5/bin/rake
and I don't believe it's an "OS thing".

You could try adding a similar statement such as the one I've used, in your cron environment...
Code:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Verify executable using whereis (or locate on CentOS...)
Code:
whereis rake bundle ruby

Hope that helps.
 
Old 11-22-2017, 01:02 AM   #4
giis
Member
 
Registered: Nov 2013
Location: Third Rock from Moon
Distribution: RPM/DEB based and LFS
Posts: 73

Rep: Reputation: Disabled
Most often the issue will be related to using absolute path name. Check all executable has absolute path not using relative paths.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab issue shaykoh Linux - Newbie 4 10-30-2014 09:50 AM
One issue with Crontab abhitanshu Linux - Server 3 09-24-2012 02:34 PM
[SOLVED] Crontab issue pinga123 Linux - General 2 03-17-2011 01:56 AM
Redmine Issue tab divyashree Linux - Newbie 9 11-03-2010 12:15 PM
Troubles wrinting in file (C++) for application in crontab yakotey Programming 6 11-22-2005 09:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration