Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect crontab generated when using "days after/before" #820

Open
alecvn opened this issue Oct 5, 2021 · 0 comments
Open

Incorrect crontab generated when using "days after/before" #820

alecvn opened this issue Oct 5, 2021 · 0 comments

Comments

@alecvn
Copy link

alecvn commented Oct 5, 2021

Chronic correctly parses the following:

> Chronic.parse('4 days after start of month at 1pm')
=> 2021-10-05 13:00:00 +0200

However, the crontab the following generates:

every 1.month, at: '4 days after start of month at 1pm' do
  rake "execute_some_task"
end

Is incorrect:

0 13 1 * * /bin/bash -l -c 'cd /home/path/to/project && RAILS_ENV=development bundle exec rake execute_some_task --silent'

As it schedules the job for the 1st day of every month instead.

  • This example is just to simplify the issue for illustrative purposes, in reality I'm attempting to have the job run 4 days before the end of the month, but that comes with its own nuances.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant