Skip to content

Commit

Permalink
Update cron config (#145)
Browse files Browse the repository at this point in the history
* cleaned up cron config

* use cron_enabled

* use cron_user

* update rook4

* update rook3
  • Loading branch information
cehbrecht authored Feb 9, 2024
1 parent 51e0bc7 commit 82a2bdf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion etc/rook3_dkrz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ service_gid: 399

# enable cronjob to clean outputs
cron_mailto: ehbrecht@dkrz.de
cron_disabled: no
cron_enabled: yes
cron_user: root
wps_outputs_keep_days: 0
wps_temp_keep_days: 0
# conda
Expand Down
3 changes: 2 additions & 1 deletion etc/rook4_dkrz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ service_gid: 399

# enable cronjob to clean outputs
cron_mailto: ehbrecht@dkrz.de
cron_disabled: no
cron_enabled: yes
cron_user: root
wps_outputs_keep_days: 0
wps_temp_keep_days: 0
# conda
Expand Down
5 changes: 4 additions & 1 deletion group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@ ssl_certs_path_owner: "{{ service_user }}"
ssl_certs_path_group: "{{ service_group }}"

# cron
cron_enabled: false
cron_disabled: "{{ cron_enabled | bool == false }}"
cron_mailto: root
cron_disabled: yes
cron_user: root


# roocs
roocs_enabled: false
Expand Down
15 changes: 6 additions & 9 deletions roles/pywps/tasks/cronjob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
- name: Clear wps outputs
cron:
name: "clear wps outputs"
special_time: daily
user: "{{ service_user }}"
special_time: hourly
user: "{{ cron_user }}"
job: 'find {{ wps_basedir }}/outputs/* -maxdepth 1 -type d -mtime +{{ wps_outputs_keep_days }} -regextype sed -regex ".*/[a-f0-9\-]\{36\}$" -exec rm -rf {} \;'
cron_file: ansible_pywps
disabled: "{{ cron_disabled }}"
Expand All @@ -25,8 +25,8 @@
- name: Clear wps status
cron:
name: "clear wps status"
special_time: daily
user: "{{ service_user }}"
special_time: hourly
user: "{{ cron_user }}"
job: 'find {{ wps_basedir }}/outputs/* -maxdepth 1 -type f -mtime +{{ wps_outputs_keep_days }} -regextype sed -regex ".*/[a-f0-9\-]\{36\}\.xml$" -delete'
cron_file: ansible_pywps
disabled: "{{ cron_disabled }}"
Expand All @@ -35,8 +35,8 @@
- name: Clear wps tempfiles
cron:
name: "clear wps tempfiles"
special_time: daily
user: "{{ service_user }}"
special_time: hourly
user: "{{ cron_user }}"
job: 'find {{ wps_basedir }}/tmp/* -maxdepth 1 -type d -mtime +{{ wps_temp_keep_days }} -name "pywps_process_*" -exec rm -rf {} \;'
cron_file: ansible_pywps
disabled: "{{ cron_disabled }}"
Expand All @@ -53,7 +53,6 @@
template:
src: ./templates/restart-pywps.sh.j2
dest: "{{ cron_script_dir }}/restart-pywps.sh"
# owner: "{{ service_user }}"
owner: root
mode: 0744

Expand All @@ -63,7 +62,6 @@
# weekday: "0"
minute: "0"
hour: "3"
# user: "{{ service_user }}"
user: root
job: "{{ cron_script_dir }}/restart-pywps.sh {{ item.name }} 2>&1 > /var/log/pywps/restart-{{ item.name }}.log"
cron_file: ansible_pywps
Expand All @@ -76,6 +74,5 @@
template:
src: ./templates/smoke.sh.j2
dest: "{{ cron_script_dir }}/smoke.sh"
# owner: "{{ service_user }}"
owner: root
mode: 0744

0 comments on commit 82a2bdf

Please sign in to comment.