Comments (3)
Can you try with v0.6, see if that works.
from docker-crontab.
That doesn't work either.
Docker compose:
crontab:
# build: .
image: willfarrell/crontab:0.6.0
restart: always
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "${PWD}/config/config.yaml:/opt/crontab/config.yaml:ro"
- "${PWD}/config-samples/config.sample.json:/opt/crontab/config.json:ro"
- "${PWD}/logs:/var/log/crontab:rw"
Config.json
[
{
"comment": "map a volume",
"schedule": "* * * * *",
"dockerargs": "-d -v /tmp:/tmp",
"command": "echo new",
"image": "alpine:3.5"
}
]
crontab_1 | 2021-01-01T10:41:21.552122125Z ##### crontab generation complete #####
crontab_1 | 2021-01-01T10:41:21.552632617Z # map a volume
crontab_1 | 2021-01-01T10:41:21.552646044Z * * * * * /bin/bash /opt/crontab/jobs/a37a44d3-fa7e-42a3-8067-e15dc0fe0273.sh
crontab_1 | 2021-01-01T10:41:21.552692428Z ##### run commands with onstart #####
crontab_1 | 2021-01-01T10:41:21.552767279Z crond -f -d 6 -c /etc/crontabs
crontab_1 | 2021-01-01T10:41:21.553190399Z crond: crond (busybox 1.31.1) started, log level 6
crontab_1 | 2021-01-01T10:42:00.553702943Z crond: USER docker pid 98 cmd /bin/bash /opt/crontab/jobs/a37a44d3-fa7e-42a3-8067-e15dc0fe0273.sh
crontab_1 | 2021-01-01T10:42:00.554789771Z Start Cronjob **a37a44d3-fa7e-42a3-8067-e15dc0fe0273** map a volume
crontab_1 | 2021-01-01T10:42:00.908710241Z 1f1b7b4b527ba926b4c9b33e1d7cbea932ebcd49190134db81db397904448bd5
crontab_1 | 2021-01-01T10:42:02.317511655Z End Cronjob **a37a44d3-fa7e-42a3-8067-e15dc0fe0273** map a volume
crontab_1 | 2021-01-01T10:43:00.554039511Z crond: USER docker pid 189 cmd /bin/bash /opt/crontab/jobs/a37a44d3-fa7e-42a3-8067-e15dc0fe0273.sh
crontab_1 | 2021-01-01T10:43:00.555075296Z Start Cronjob **a37a44d3-fa7e-42a3-8067-e15dc0fe0273** map a volume
crontab_1 | 2021-01-01T10:43:01.755776060Z dd678351875a1fd595a1460bd28f24fc6a6bfb97cfeffb5e9a1d2b174d8434ca
crontab_1 | 2021-01-01T10:43:04.093320629Z End Cronjob **a37a44d3-fa7e-42a3-8067-e15dc0fe0273** map a volume
The volume is mapped correctly and I can see the jobs.log
file is getting created, but it is an empty file
from docker-crontab.
Same problem:
docker-compose:
crontab01:
image: willfarrell/crontab:1.0.0
container_name: crontab01
# environment:
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
# - ./env:/opt/env:ro
# - ./docker-compose-crontab/opt/crontab:/opt/crontab:rw
- ./docker-compose-crontab/opt/crontab/config.yml:/opt/crontab/config.yml:rw
# - ./crontab01-docker/var/log/crontab:/var/log/crontab:rw
restart: always
# healthcheck:
network_mode: none
# networks:
# command:
config.yml
redmine_plugin_recurring_task:
command: sh -c 'cd /home/redmine/redmine && RAILS_ENV=production bundle exec rake redmine_recurring_tasks:exec'
comment: redmine_plugin_recurring_task
container: redmine01
# project: docker-compose-redmine
schedule: '@every 1m'
Logs
2021-02-03T13:20:24.664390515Z ##### crontab generation complete #####
2021-02-03T13:20:24.665872468Z # redmine_plugin_recurring_task
2021-02-03T13:20:24.665918845Z */1 * * * * /bin/bash /opt/crontab/jobs/810847fb-441a-439c-9885-e3c04e59e7e9.sh
2021-02-03T13:20:24.666450460Z ##### run commands with onstart #####
2021-02-03T13:20:24.666786865Z crond -f -d 6 -c /etc/crontabs
2021-02-03T13:20:24.668117210Z crond: crond (busybox 1.31.1) started, log level 6
2021-02-03T13:21:00.670243017Z crond: USER docker pid 138 cmd /bin/bash /opt/crontab/jobs/810847fb-441a-439c-9885-e3c04e59e7e9.sh
2021-02-03T13:21:00.674956752Z Start Cronjob **810847fb-441a-439c-9885-e3c04e59e7e9** redmine_plugin_recurring_task
2021-02-03T13:21:12.226642170Z End Cronjob **810847fb-441a-439c-9885-e3c04e59e7e9** redmine_plugin_recurring_task
I tought i had a problem with volumes, but inside the container i still dont get any log:
bash-5.0# pwd
/var/log/crontab
bash-5.0# cat jobs.log
bash-5.0#
from docker-crontab.
Related Issues (20)
- Cron not working for scheduler in Laravel app (different container)
- Timezone Needed HOT 1
- Where can I find the job in the list?
- Why the CPU usage will have a spike every few seconds?
- Default to current project when using docker-compose
- Crond since Version 1.0.0 not running HOT 1
- /etc/crontabs/docker not found HOT 1
- Hardcoded RQ version
- Does not work with DOCKER_HOST HOT 1
- Getting offered a new latest docker image each day HOT 4
- Start/Stop other containers HOT 1
- Feature Request: run docker task as a different user HOT 3
- Add running date into logs HOT 1
- Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock in macOS HOT 2
- Host specific config
- Configuration cleanup/jobs clean up HOT 1
- crond: user docker: process already running HOT 1
- is it possible to change the timezone of the cron container?
- Dash '-' vs. underscore '_' after project name in container naming
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-crontab.