-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcron.example
52 lines (43 loc) · 2.57 KB
/
cron.example
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# _ __ _______ _____ _ _
# | | \ \ / / __ \ / ____| | | |
# | | \ V /| | | | | | | | ___ _ _ __| |
# | | > < | | | | | | | |/ _ \| | | |/ _` |
# | |____ / . \| |__| | | |____| | (_) | |_| | (_| |
# |______/_/ \_\_____/ \_____|_|\___/ \__,_|\__,_|
#
#
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
# * * * * * command --arg1 --arg2 file1 file2 2>&1
# record the stats for servers in database for monitoring
*/15 0-1 * * * root ansible-playbook /etc/ansible/lxd_cloud/playbooks/linux_all/monitor/playbook.yaml
*/15 4-23 * * * root ansible-playbook /etc/ansible/lxd_cloud/playbooks/linux_all/monitor/playbook.yaml
# check health of containers and restore if container in error state
*/30 0-1 * * * root ansible-playbook /etc/ansible/lxd_cloud/playbooks/linux_hosts/revive/playbook.yaml
*/30 4-23 * * * root ansible-playbook /etc/ansible/lxd_cloud/playbooks/linux_hosts/revive/playbook.yaml
# perform server backups
5 2 * * * root screen -d -m ansible-playbook /etc/ansible/lxd_cloud/playbooks/linux_backup_servers/vault/playbook.yaml --extra-vars "backup_server=vault-1.example.com"
10 2 * * * root screen -d -m ansible-playbook /etc/ansible/lxd_cloud/playbooks/linux_backup_servers/vault/playbook.yaml --extra-vars "backup_server=vault-2.example.com"
# update nagios hosts based /etc/ansible/hosts
0 9 * * 2 root ansible-playbook /etc/ansible/lxd_cloud/playbooks/apps/nagios/sync-hosts/playbook.yaml
# update LXD hosts machines packages using repo
0 8 * * 2 root screen -d -m ansible-playbook /etc/ansible/lxd_cloud/playbooks/linux_hosts/update/playbook.yaml
# get and email a list of server processes
30 11 * * * root screen -d -m ansible-playbook /etc/ansible/lxd_cloud/playbooks/linux_all/status/processes/playbook.yaml
# kill any hung ansible processes that should be done by now
55 1 * * * root killall --older-than 1h ansible-playbook
# remove old hosts files backup
0 1 * * * root rm /etc/ansible/hosts.*
#
# SYS ADMIN MANUAL TASKS
#
# AT LEAST WEEKLY : check status of LXD Cloud
# /etc/ansible/whatisup.sh
#
# AT LEAST WEEKLY : update servers packages with oversight
# screen -d -m ansible-playbook /etc/ansible/lxd_cloud/playbooks/linux_all/updates/playbook.yaml