# /etc/cron.d/carecollect
SHELL=/bin/sh
PATH=/usr/local/bin:/usr/bin:/bin
MAILTO=ops@caresoft.co.in

# Yesterday's figures. Safe to re-run; it replaces a day rather than adding.
20 0 * * *   www-data  php /var/www/carecollect/bin/console.php rollup >> /var/log/carecollect/rollup.log 2>&1

# Tomorrow's slots from the templates, 45 days ahead.
40 0 * * *   www-data  php /var/www/carecollect/bin/console.php slots:generate >> /var/log/carecollect/slots.log 2>&1

# Next month's partitions, two months ahead. If this stops, inserts pile into
# pmax and the append-only tables slowly degrade.
0 2 1 * *    www-data  php /var/www/carecollect/bin/console.php partitions >> /var/log/carecollect/partitions.log 2>&1

# Expired tokens and sessions.
30 3 * * *   www-data  php /var/www/carecollect/bin/console.php prune >> /var/log/carecollect/prune.log 2>&1

# Backup at 01:00, before the day starts anywhere in India.
0 1 * * *    root      /var/www/carecollect/deploy/backup.sh >> /var/log/carecollect/backup.log 2>&1

# Preflight once a day. It is how you find out a cron stopped two weeks ago.
0 7 * * *    www-data  php /var/www/carecollect/bin/preflight.php >> /var/log/carecollect/preflight.log 2>&1
