infra/ansible/inventory/group_vars/debops_all_hosts/cron.yml

26 lines
614 B
YAML
Executable File

---
cron__jobs:
'renew-cert':
special_time: 'daily'
job: '/usr/bin/certbot renew --standalone >> /var/log/le-renew.log'
'check-disk-space':
special_time: 'hourly'
job: '/usr/local/lib/check-disk-space'
custom_files:
- dest: '/usr/local/lib/check-disk-space'
content: |
#!/bin/bash
CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')
THRESHOLD=80
if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
mail -s "Disk Space $(hostname).bij1.net" log@bij1.org << EOF
Used disk: $CURRENT%
EOF
fi