docker-crontab icon indicating copy to clipboard operation
docker-crontab copied to clipboard

/etc/crontabs/docker not found

Open senese opened this issue 4 years ago • 1 comments

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.

senese avatar May 25 '21 00:05 senese

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.

jalbstmeijer avatar Jul 04 '21 10:07 jalbstmeijer