# /etc/cron.d/hosting-tools: crontab fragment
MAILTO=""
SHELL_FRONTEND="noninteractive"

# rsnapshot of /srv/www
15 */4 * * *     root   /usr/bin/flock -w 300 /tmp/backup.lock -c '/usr/local/bin/rsnapshot.sh hourly'
20 7 * * *       root   /usr/bin/flock -w 300 /tmp/backup.lock -c '/usr/local/bin/rsnapshot.sh daily'

# storage-box backup
45 2 * * *       root   sleep `numrandom /0..45/`m ; /usr/bin/flock -w 0 /tmp/storage-box-backup.lock  -c '/usr/local/bin/storageBoxBackup.bash'

# compress images of /srv/www
10 2 * * *       root   /usr/bin/flock -w 0 /tmp/compressImages.lock  -c '/usr/local/bin/compressImages.sh'

# WEBROOT / DNS CHALLENGE
# Renew SSL certificates via webroot (of dns if set in .autodns)
# NOTE: If the SSL challenge via STANDALONE is enabled, this challenge must be disabled!
0 7 * * *    root   sleep `numrandom /0..30/`m ; /usr/local/bin/certbotRenewAndReloadServices.sh

# clean temp dirs (delete all files older than certain number of days) or larger than 8M and empty directories
0,20,40 * * * *  root   /usr/local/bin/cleanUpTempDir.sh

# clean session files (delete all files older certain number of minutes)
1,21,41 * * * *  root   /usr/local/bin/cleanUpSessions.sh

# apt upgrade
15 9 * * 2       root /usr/local/bin/aptUpgrade.sh

# f2b log
*/1 * * * *      root /bin/bash /usr/local/bin/get_fail2ban_jails_info.sh -p /var/log/fail2ban_jails.log -i
