javan / javan/whenever

Cron Job is not working - 'No such file or directory' error

Open
#723 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
8.9k
Forks
715
PR merge metrics
No merged PRs in 30d

Description

I wrote below content in Crontab -e for my rails project.
That project is deployed on production(CentOS- Amazon).

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/bash -l -c 'cd /var/www/houseq/current && RAILS_ENV=production bundle exec bin/rails runner -e production '\''TaskSchedulerJob.perform_now'\'''

but there is no working. thus I execute TaskSchedulerJob.perform_now command by manually.

if I execute /bin/bash -l -c 'cd /var/www/houseq/current && RAILS_ENV=production bundle exec bin/rails runner -e production '\''TaskSchedulerJob.perform_now'\''' command, they shows below error

No such file or directory

help!!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the crontab entry and reproduce the exact /bin/bash -l -c command shown in the issue, comparing it with the manual TaskSchedulerJob.perform_now invocation. Check the generated cron command and its production environment; done means the scheduled command runs successfully without the “No such file or directory” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, rails, ruby
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.