Kerhost
Installation
Interfaces
Modules de gestion
Divers
Kerhost
Installation
Interfaces
Modules de gestion
Divers
La crontab est un service interne à unix qui permet d'automatiser des tâches. Pour KerHost, un certain nombre de tâches se fait automatiquement à des instants particuliers :
Pour les sauvegardes :
Vous pouvez modifier le fichier crontab /ect/crontab
avec la ligne de commande sudo nano /etc/crontab
à votre guise (déconseillé si vous ne savez pas ce que vous faites !). En effet, les sauvegardes peuvent prendre beaucoup de temps en fonction du volume de données utilisateurs à sauvegarder. Il faut toujours faire en sorte que les sauvegardes ne se chevauchent pas.
Exemple de fichier crontab avec une sauvegarde de type Rsync SSH :
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Example of job definition: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
# | | | | |
# * * * * * user-name command to be executed
17 * * * * root cd / && run-parts –report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts –report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts –report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts –report /etc/cron.monthly )
#
# Tini Tiny
*/10 * * * * www-rss /usr/bin/php /var/www/rss/update.php –feeds –quiet > /dev/null
# Awstats
*/30 * * * * root /usr/lib/cgi-bin/awstats.pl -config=www.domaine.fr -update > /dev/null
*/30 * * * * root /usr/lib/cgi-bin/awstats.pl -config=mail.domaine.fr -update > /dev/null
# Services instables
00 07 * * * root /etc/init.d/etherpad stop && /etc/init.d/etherpad start > /dev/null 2>&1
05 07 * * * root /etc/init.d/uwsgi stop && /etc/init.d/uwsgi start > /dev/null 2>&1
## Lufi
50 23 * * * root /opt/cronlufi > /dev/null 2>&1
# Rkhunter
00 21 * * 1 root /usr/bin/rkhunter –update –nocolors | mail -s '[DOMAINE.FR][RKHUNTER]-Rapport Mise a jour quotidienne' domaine@domaine.fr
05 21 * * 1 root /usr/bin/rkhunter –checkall –rwo –nocolors –skip-keypress | mail -s '[DOMAINE.FR][RKHUNTER]-Rapport scan quotidien' domaine@domaine.fr
# ChkRootKit
10 21 * * 1 root /usr/sbin/chkrootkit | mail -s '[DOMAINE.FR][CHKROOTKIT]-Rapport scan quotidien' domaine@domaine.fr
# Kerhost
00 20 * * 1 www-kerhost /usr/bin/php-cgi -f /var/www/kerhost/cron/cronquotaverif.php cron_token=[…] > /dev/null
00 20 28 * * www-kerhost /usr/bin/php-cgi -f /var/www/kerhost/cron/cronquotamaj.php cron_token=[…] > /dev/null
25 21 1 * * www-kerhost /usr/bin/php-cgi -f /var/www/kerhost/cron/croncomptaserver.php cron_token=[…] > /dev/null
30 21 * * * www-kerhost /usr/bin/php-cgi -f /var/www/kerhost/cron/croncomptadns.php cron_token=[…] > /dev/null
35 21 * * 1 www-kerhost /usr/bin/php-cgi -f /var/www/kerhost/cron/cronverifmajservice.php cron_token=[…] > /dev/null
40 21 * * * www-kerhost /usr/bin/php-cgi -f /var/www/kerhost/cron/cronaliasmailtempdel.php cron_token=[…] > /dev/null
45 21 * * 5 www-kerhost /usr/bin/php-cgi -f /var/www/kerhost/cron/cronsquidguardupdate.php cron_token=[…] > /dev/null
# Let'sEncrypt
50 21 * * 2 root /usr/bin/certbot renew –pre-hook '/etc/init.d/apache2 stop' –post-hook '/etc/init.d/apache2 start' | mail -s '[DOMAINE.FR][LETSENCRYPT]-Rapport quotidien renouvellement certificats' domaine@domaine.fr
55 21 * * 2 root /etc/prosody/renewcertletsencrypt 2>&1
57 21 * * 2 root /etc/courier/renewcertletsencrypt 2>&1
# Sauvegardes
00 22 * * * www-kerhost /usr/bin/php-cgi -f /var/www/kerhost/cron/cronsvgbdd.php cron_token=[…] > /dev/null
00 00 * * * www-kerhost /usr/bin/php-cgi -f /var/www/kerhost/cron/cronsvgallrsync.php cron_token=2[…] > /dev/null