mg
0901e98181
Syntax Variabgle monat ergänzt, scrub jetzt jeden 2. monat am 14. Sanoid cron kann jetzt dom(day of month) Vars trim entfernt Co-authored-by: Michael Grote <michael.grote@posteo.de> Reviewed-on: mg/ansible#69 Co-Authored-By: mg <mg@noreply.git.mgrote.net> Co-Committed-By: mg <mg@noreply.git.mgrote.net>
20 lines
919 B
YAML
20 lines
919 B
YAML
---
|
|
- name: remove system scrub job #https://forum.proxmox.com/threads/script-sequential-zfs-scrub-for-cron.25124/
|
|
become: true
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/cron.d/zfsutils-linux
|
|
state: absent
|
|
line: '24 0 8-14 * * root [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ] && /usr/lib/zfs-linux/scrub'
|
|
|
|
- name: add cronjob "zfs-scrub"
|
|
become: yes
|
|
ansible.builtin.cron:
|
|
name: zfs-scrub - "{{ item.name }}"
|
|
state: present
|
|
job: "{{ zfs_extra_path_zpool }} scrub {{ item.name }}"
|
|
month: "{{ item.cron_month_zfs_scrub | default('*') }}"
|
|
weekday: "{{ item.cron_day_of_week_zfs_scrub | default('7') }}"
|
|
day: "{{ item.cron_day_of_month_zfs_scrub | default('*/21') }}"
|
|
hour: "{{ item.cron_hour_zfs_scrub | default('23') }}"
|
|
minute: "{{ item.cron_minutes_zfs_scrub | default('30') }}"
|
|
with_items: "{{ zfs_extra_zfs_pools }}"
|