1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/bin/bash
ADEI_PATH=${ADEI_PATH:-/srv/www/htdocs/adei}
ADEI_ADMIN=${ADEI_ADMIN:-0}
date=$(date -Iseconds)
[ -f /adei/env ] && . /adei/env
if [ "$ADEI_ADMIN" -ne 1 -a -f "/adei/cfg/.debug" ]; then
echo "$date ADEI is under debug, skipping..."
exit
fi
script=$( cd $(dirname "$0") && pwd )/$( basename "$0" )
if [ -f /adei/sys/adei_clean.cron.sh -a "$script" != /adei/sys/adei_clean.cron.sh ]; then
/adei/sys/adei_clean.cron.sh
exit
fi
adei_path="$ADEI_PATH"
path="$adei_path/tmp/clients/"
find $path -type f -mtime +1 -exec rm -f '{}' \;
find $path -mindepth 1 -type d -empty -mtime +1 -delete
# atype is not always enabled
#find $path -type f -atime +0 -exec rm -f '{}' \;
#find $path -type d -empty -atime +1 -mindepth 1 -delete
path="$adei_path/tmp/log/"
find $path -type f -mtime +14 -exec rm -f '{}' \;
|