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

Crontab issue on Windows host machine #1432

Closed
psolom opened this issue Mar 16, 2018 · 2 comments
Closed

Crontab issue on Windows host machine #1432

psolom opened this issue Mar 16, 2018 · 2 comments

Comments

@psolom
Copy link

psolom commented Mar 16, 2018

I use Windows as a host machine for laradock application.

The issue I faced is that cron is sensitive to line endings in crontab files. You can see ^M when run cat -v /etc/cron.d/laradock character in case of DOS-like endings. Cron won't run such files. To solve the issue I have replaced the following lines of workspace\Dockerfile-{version} dockerfile(s):

#####################################
# Crontab
#####################################
USER root

COPY ./crontab /etc/cron.d
RUN chmod -R 644 /etc/cron.d

to

#####################################
# Crontab
#####################################
USER root

COPY ./crontab /etc/cron.d
RUN chmod -R 644 /etc/cron.d

# convert line endings from DOS to UNIX format
RUN apt-get update -yqq && \
    apt-get install dos2unix && \
    find /etc/cron.d -type f -print0 | xargs -0 dos2unix

The dos2unix utility converts all DOS-like line endings to UNIX format. This can prevent implicit cron errors if you use Windows OS and save you time. May be included into the main package if you will find this useful.

@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants