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

/etc/crontabs/docker not found #44

Open
senese opened this issue May 25, 2021 · 1 comment
Open

/etc/crontabs/docker not found #44

senese opened this issue May 25, 2021 · 1 comment

Comments

@senese
Copy link

senese commented May 25, 2021

When I am trying to run the image to perform a crontab job on my other running container, I get that message:

NO CONFIG FILE FOUND

crontab generation complete

cat: can't open '/etc/crontabs/docker': No such file or directory

I am using this command to run the container:
docker run -v /var/run/docker.sock:/var/run/docker.sock:ro -v config.yaml:/opt/crontab:rw willfarrell/crontab

It's difficult to debug this because the documention lacks information about this file.

@jalbstmeijer
Copy link

jalbstmeijer commented Jul 4, 2021

Hi, had the same issue. Doc is indeed not very clear on this.
After fiddling around, got it to work.
The error just means it did not find any config.

So what I did;
mkdir -p /path/crontab/config
mkdir -p /path/crontab/logs

placed a /path/crontab/config/config.json

[{
"schedule":"@every 5m",
"command":"wget -O /dev/null https://google.com"
}]

docker run -d -v /var/run/docker.sock:/var/run/docker.sock:ro -v /path/crontab/config:/opt/crontab:rw -v /path/crontab/logs:/var/log/crontab:rw willfarrell/crontab

files /path/crontab/config/config.working.json and /path/crontab/config/jobs/*.sh will be generated if the config.json was valid.

Hope it helps.

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