Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sol1 Ansible Roles
sol1-db_backup
Commits
1ae76b1a
Commit
1ae76b1a
authored
Dec 16, 2020
by
Matthew Smith
Browse files
type is a required value
parent
a6500979
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.MD
View file @
1ae76b1a
...
...
@@ -9,12 +9,14 @@ db_backup_crond:
- name: "mysql"
- name: "example"
cron:
command: "{{ db_backup_cron_default.command }} example"
command: "{{ db_backup_cron_default.command }} example
-t mysql
"
- name: "example2"
cron:
command: "{{ db_backup_cron_default.command }} -o '-Fc' -t 'pgsql'
example2
"
command: "{{ db_backup_cron_default.command }}
example2
-o '-Fc' -t 'pgsql'"
minuite: 2
hour: 3
```
Database name (-d) and Type (-t) are required fields, db_backup_cron_default.command is default script path + -d
Note: the cron defaults are sensible but not infalible, best to be explicit in setting them if unsure
\ No newline at end of file
templates/etc/cron.d/cronjob.j2
View file @
1ae76b1a
...
...
@@ -8,7 +8,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
{% for job in db_backup_crond %}
{% if job.name is defined %}
{{ job.cron.minuite | default(db_backup_cron_default.minuite * loop.index ) }} {{ job.cron.hour | default(db_backup_cron_default.hour) }} {{ job.cron.day | default(db_backup_cron_default.day) }} {{ job.cron.month | default(db_backup_cron_default.month) }} {{ job.cron.dayofweek | default(db_backup_cron_default.dayofweek) }} {{ job.cron.user | default(db_backup_cron_default.user) }} {% if job.cron.command is defined %} {{ job.cron.command }} {% else %} {{ db_backup_cron_default.command }} {{ job.name }} {% endif %}
{{ job.cron.minuite | default(db_backup_cron_default.minuite * loop.index ) }} {{ job.cron.hour | default(db_backup_cron_default.hour) }} {{ job.cron.day | default(db_backup_cron_default.day) }} {{ job.cron.month | default(db_backup_cron_default.month) }} {{ job.cron.dayofweek | default(db_backup_cron_default.dayofweek) }} {{ job.cron.user | default(db_backup_cron_default.user) }} {% if job.cron.command is defined %} {{ job.cron.command }} {% else %} {{ db_backup_cron_default.command }} {{ job.name }}
-t mysql
{% endif %}
{% endif %}
{% endfor %}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment