A
A
Andrei St2017-09-06 12:59:49
linux
Andrei St, 2017-09-06 12:59:49

How to run Ruby script with cron?

I want Redmine to take letters via imap from the mail server, for this I did the script as in the article and call it via cron and get an error.
If you go into
and run the ./redminemail.sh command, then everything is OK, but so far it has not been possible through cron.
In cron line
*/1 * * * * root /usr/bin/bash /opt/redmine-3.4.2/redminemail.sh 2>/var/log/cron-out.log
Script called with cron
cat /opt/redmine -3.4.2/redminemail.sh

#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/redmine-3.4.2/bin/:/usr/local/rvm/rubies/ruby-2.3.0/bin/:/usr/local/rvm/gems/ruby-2.3.0/bin/:/usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks
/usr/local/rvm/gems/ruby-2.3.0/bin/rake -f /opt/redmine-3.4.2/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=mail.мой-домен.ru [email protected]мой-домен.ru password=мой-пароль port=993 ssl=1 project=test_pr2 no_permission_check=1 unknown_user=accept

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
chupasaurus, 2017-09-06
@chupasaurus

First, remove the word from the line in cron root, then find out what /usr/bin/bash: No such file or directorybash is in /bin(which is written in your own script).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question