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

Cron does not work until re-edit crontab contents #193

Open
dobryakov opened this issue Jul 4, 2017 · 4 comments
Open

Cron does not work until re-edit crontab contents #193

dobryakov opened this issue Jul 4, 2017 · 4 comments

Comments

@dobryakov
Copy link

Hello.
I setup crontab inside container in Dockerfile by this way:

RUN cat /home/app/crontab.txt | crontab -u app -

I see my cron tasks inside container by run crontab -u app -l successfully.

But cron does not work until I run crontab -u app -e manually, change nothing, and save it again. After this inexplicable manipulation my crontasks begin to work successfully.

Why? I have my brain broken trying to understand. What's wrong? Please help.

Image version 0.9.22

@dobryakov
Copy link
Author

sv restart cron does not help. Only manual re-edit helps.

@dobryakov
Copy link
Author

The file crontab.txt has correct linux line endings (LF).

@dobryakov
Copy link
Author

Applied workaroud

# Dockerfile
RUN echo "#!/bin/bash\ntouch /etc/crontab /etc/cron.d/* /var/spool/cron/crontabs/*" >> /etc/my_init.d/touch-crond && chmod 744 /etc/my_init.d/touch-crond

@mech
Copy link

mech commented Jun 14, 2018

I physically "docker exec" into the container and installed a cron jobs under "app" user, but it does not seems to work. Wondering if you have come to a conclusion?

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

2 participants