Comments (7)
Hi,
The cron job is written out to disk at a specific path instead of being accessible with crontab -l
.
Check out /etc/cron.d/
on your server. You should see the cron job(s) there.
from ansible-docker.
Indeed it's there, thanks!
from ansible-docker.
No problem. The reason for that stemmed from this issue: #35
from ansible-docker.
The cron job is written out to disk at a specific path instead of being accessible with
crontab -l
.
Iยดd love to understand this. why to write it directly instead of doing it via Crontab? how do you manage it? what is the logic behind all this?
from ansible-docker.
It's more straight forward to be able to see a list of cron jobs on your system by going to a centralized place on your file system (/etc/cron.d
) than wondering which cron jobs exist in each user's crontab -l
. You can still run cron jobs as a non-root user with the /etc/cron.d
approach since one of the arguments of the cron job is picking which user it runs as.
From an automation standpoint it's also easier to only have to think about adding and removing files in a directory instead of parsing a crontab file from 1 or more user accounts.
from ansible-docker.
So if i understood correctly by just dropping files into /etc.d/daily, weekly, monthly scripts will be executed. How do you specify the user and the time?
I'm still a bit confused
from ansible-docker.
Yes, they just need to exist in any of those directories and cron picks it up automatically. You don't need to restart anything.
My role does this by default:
docker__cron_jobs_prune_flags: "af"
docker__cron_jobs_prune_schedule: ["0", "0", "*", "*", "0"]
docker__cron_jobs:
- name: "Docker disk clean up"
job: "docker system prune -{{ docker__cron_jobs_prune_flags }} > /dev/null 2>&1"
schedule: "{{ docker__cron_jobs_prune_schedule }}"
cron_file: "docker-disk-clean-up"
user: "{{ (docker__users | first) | d('root') }}"
You can override those variables as needed if you want to change things.
By default it runs the cron job every Sunday at midnight, that's what ["0", "0", "*", "*", "0"]
is, you can verify it here: https://crontab.guru/#0_0_*_*_0
from ansible-docker.
Related Issues (20)
- Support for docker.io package (in addition to ce and ee) HOT 4
- Failed : Install Docker's dependencies HOT 9
- Package dependency error for Docker installation on clean Ubuntu 18.04 HOT 11
- Ubuntu 20.04 ImportError: No module named pkg_resources HOT 10
- Avoid docker login issue with X11 HOT 11
- Expected behavior for DockerHub private repositories login options? HOT 19
- Failed to import the required Python library HOT 10
- Update apt cache before installing packages HOT 1
- Add way to add additional packages to install HOT 3
- Versioning pinning not working HOT 5
- Install Python packages: Could not get output from /usr/local/bin/virtualenv --help HOT 16
- Hi; Please consider suppressing credentials output in: Manage Docker registry login credentials HOT 8
- Upgrade edge case HOT 9
- I'm thinking about no longer setting up a virtualenv, pip installing docker / docker compose and switching the docker_login module to a shell script HOT 2
- docker not installed into /usr/local/bin HOT 4
- Unable to find pip in the virtualenv HOT 8
- Error in new v2.2.0 version when using ansible 2.9.14 HOT 3
- Docker Compose V1 causes the Install Python packages step to crash HOT 3
- Error with pip on basic usage HOT 2
- Task exception at: Install Python packages HOT 6
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 ansible-docker.