-
Notifications
You must be signed in to change notification settings - Fork 8
/
cron.yml
37 lines (33 loc) · 1.05 KB
/
cron.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
- name: Add cron to delete directories of successful jobs older than 60 minutes
cron:
name: "delete successful directories"
minute: "21"
hour: "*/2"
job: "find {{ pulsar_data_path }}/staging/*/postprocessed -type f -amin +60 -exec dirname {} \\; | xargs rm -rf "
- name: Add cron to delete directories of unsuccessful jobs older than 10 days
cron:
name: "delete unsuccessful directories"
minute: "21"
hour: "3"
job: "find {{ pulsar_data_path }}/staging/ -maxdepth 1 -mindepth 1 -type d -ctime +10 -exec rm -rf {} +"
- name: Add cron to restart pulsar
cron:
name: "restart Pulsar to take care of RabbitMQ shutdown issue"
minute: "11"
hour: "6"
job: "sudo systemctl restart pulsar"
- name: Copy update-host script
become: yes
template:
src: update-hosts.sh.j2
dest: /usr/bin/update-hosts
mode: 0744
- name: Creates a cron file under /etc/cron.d
become: yes
cron:
name: update hosts
special_time: hourly
user: root
job: "/usr/bin/update-hosts"
cron_file: ansible_update_hosts