Changement "qui" lance les crons des logs
Nice sur les cron de logs
This commit is contained in:
parent
6669a07434
commit
7ce6291039
|
@ -2,14 +2,14 @@
|
||||||
0 4 * * * root /usr/lib/alternc/rawstat.daily
|
0 4 * * * root /usr/lib/alternc/rawstat.daily
|
||||||
|
|
||||||
# Every 2 days compress log files
|
# 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
|
# 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
|
# 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 5 * * * alterncpanel /usr/lib/alternc/sqlbackup.sh -t daily
|
||||||
0 4 * * 0 www-data /usr/lib/alternc/sqlbackup.sh -t weekly
|
0 4 * * 0 alterncpanel /usr/lib/alternc/sqlbackup.sh -t weekly
|
||||||
|
|
||||||
# Every 5 minutes, spool waiting domain changes
|
# Every 5 minutes, spool waiting domain changes
|
||||||
*/5 * * * * root /usr/lib/alternc/update_domains.sh
|
*/5 * * * * root /usr/lib/alternc/update_domains.sh
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
|
# How long do we wait before compressing the log ? Default: 2
|
||||||
|
DAYS=2
|
||||||
|
|
||||||
for CONFIG_FILE in \
|
for CONFIG_FILE in \
|
||||||
/etc/alternc/local.sh \
|
/etc/alternc/local.sh \
|
||||||
/usr/lib/alternc/functions.sh
|
/usr/lib/alternc/functions.sh
|
||||||
|
@ -10,7 +13,10 @@ for CONFIG_FILE in \
|
||||||
fi
|
fi
|
||||||
. "$CONFIG_FILE"
|
. "$CONFIG_FILE"
|
||||||
done
|
done
|
||||||
$days=2
|
|
||||||
#parcourir tous les logs pour trouver ceux qui on plus de 2 jours et en faire un tar.
|
#FIXME: should be define in local.sh
|
||||||
find "$ALTERNC_LOC/logs" -not -name '*.gz' -mtime +$days -exec gzip '{}' \;
|
ALTERNC_LOGS="$ALTERNC_LOC/logs"
|
||||||
|
|
||||||
|
#Compress logs older than XX days
|
||||||
|
nice 10 find "$ALTERNC_LOGS" -not -name '*.gz' -mtime +$DAYS -exec gzip '{}' \;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# How many day do we keep the logs ?
|
||||||
|
DAYS=366
|
||||||
|
|
||||||
for CONFIG_FILE in \
|
for CONFIG_FILE in \
|
||||||
/etc/alternc/local.sh \
|
/etc/alternc/local.sh \
|
||||||
/usr/lib/alternc/functions.sh
|
/usr/lib/alternc/functions.sh
|
||||||
|
@ -10,6 +13,8 @@ for CONFIG_FILE in \
|
||||||
fi
|
fi
|
||||||
. "$CONFIG_FILE"
|
. "$CONFIG_FILE"
|
||||||
done
|
done
|
||||||
days=366
|
|
||||||
#parcourir tous les logs pour trouver ceux qui on plus de 1 ans et les deletes.
|
# FIXME this var should be define in local.sh
|
||||||
find "$ALTERNC_LOC/logs" -mtime +$days -exec rm '{}' \;
|
ALTERNC_LOGS="$ALTERNC_LOC/logs"
|
||||||
|
|
||||||
|
nice 10 find "$ALTERNC_LOGS" -mtime +$DAYS -delete
|
||||||
|
|
Loading…
Reference in New Issue