Alternc  latest
Alternc logiel libre pour l'hébergement
delete_logs.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 # How many day do we keep the logs ?
4 DAYS=366
5 
6 for CONFIG_FILE in \
7  /etc/alternc/local.sh \
8  /usr/lib/alternc/functions.sh
9  do
10  if [ ! -r "$CONFIG_FILE" ]; then
11  echo "Can't access $CONFIG_FILE."
12  exit 1
13  fi
14  . "$CONFIG_FILE"
15 done
16 
17 stop_if_jobs_locked
18 
19 # ALTERNC_LOGS is from local.sh
20 find "$ALTERNC_LOGS" -type f -mtime +$DAYS -delete