# TODO who should be getting emails from cron
# TODO what emails should cron actually be sending that are useful to people?
MAILTO=brendonj@caida.org

# build ssh config and known hosts for ark nodes
4-59/5 * * * * root TMP_CONF=$(mktemp --tmpdir ssh_config.XXXXXX) && chmod 644 $TMP_CONF && TMP_HOSTS=$(mktemp --tmpdir ssh_known_hosts.XXXXXX) && chmod 644 $TMP_HOSTS && /usr/bin/ark-ssh-config --config-file $TMP_CONF --known-hosts-file $TMP_HOSTS >/dev/null 2>&1 && mv $TMP_CONF /etc/ssh/ssh_config.d/ark.conf && mv $TMP_HOSTS /etc/ssh/ssh_known_hosts.ark || echo "/usr/bin/ark-ssh-config failed"

# build /etc/monitors.yaml with other ark probe information
*/15 * * * * ark TMP_YAML=$(mktemp --tmpdir monitors.XXXXXX) && chmod 644 $TMP_YAML && /usr/bin/ark-monitors-yaml $TMP_YAML >/dev/null 2>&1 && mv $TMP_YAML /etc/ark/monitors.yaml || echo "/usr/bin/ark-monitors-yaml failed"

# TODO can we remove the files immediately after they are processed instead?
# delete old team-probing files that should have been processed
40 * * * * ark (cd /staging/team-probing.daily && find . -type f -mtime +21 -delete) >/dev/null 2>&1
