Commit 7ce62910 authored by Alan Garcia's avatar Alan Garcia

Changement "qui" lance les crons des logs

Nice sur les cron de logs
parent 6669a074
......@@ -2,14 +2,14 @@
0 4 * * * root /usr/lib/alternc/rawstat.daily
# Every 2 days compress log files
0 4 * * * root /usr/lib/alternc/compress_logs.sh
0 4 * * * alterncpanel /usr/lib/alternc/compress_logs.sh
# Suppress log files older than one year
0 4 * * * root /usr/lib/alternc/delete_logs.sh
0 4 * * * alterncpanel /usr/lib/alternc/delete_logs.sh
# Every day at 5am and every week at 4am, make requested SQL backups
0 5 * * * www-data /usr/lib/alternc/sqlbackup.sh -t daily
0 4 * * 0 www-data /usr/lib/alternc/sqlbackup.sh -t weekly
0 5 * * * alterncpanel /usr/lib/alternc/sqlbackup.sh -t daily
0 4 * * 0 alterncpanel /usr/lib/alternc/sqlbackup.sh -t weekly
# Every 5 minutes, spool waiting domain changes
*/5 * * * * root /usr/lib/alternc/update_domains.sh
......
#! /bin/bash
# How long do we wait before compressing the log ? Default: 2
DAYS=2
for CONFIG_FILE in \
/etc/alternc/local.sh \
/usr/lib/alternc/functions.sh
......@@ -10,7 +13,10 @@ for CONFIG_FILE in \
fi
. "$CONFIG_FILE"
done
$days=2
#parcourir tous les logs pour trouver ceux qui on plus de 2 jours et en faire un tar.
find "$ALTERNC_LOC/logs" -not -name '*.gz' -mtime +$days -exec gzip '{}' \;
#FIXME: should be define in local.sh
ALTERNC_LOGS="$ALTERNC_LOC/logs"
#Compress logs older than XX days
nice 10 find "$ALTERNC_LOGS" -not -name '*.gz' -mtime +$DAYS -exec gzip '{}' \;
#!/bin/bash
# How many day do we keep the logs ?
DAYS=366
for CONFIG_FILE in \
/etc/alternc/local.sh \
/usr/lib/alternc/functions.sh
......@@ -10,6 +13,8 @@ for CONFIG_FILE in \
fi
. "$CONFIG_FILE"
done
days=366
#parcourir tous les logs pour trouver ceux qui on plus de 1 ans et les deletes.
find "$ALTERNC_LOC/logs" -mtime +$days -exec rm '{}' \;
# FIXME this var should be define in local.sh
ALTERNC_LOGS="$ALTERNC_LOC/logs"
nice 10 find "$ALTERNC_LOGS" -mtime +$DAYS -delete
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment