PHP 8.2.30
Preview: cleancache.sh Size: 1.46 KB
//proc/self/root/proc/self/root/proc/self/root/proc/self/root/usr/local/lsws/admin/misc/cleancache.sh

#!/bin/sh

#if [ -f '/usr/bin/ionice' ]; then
#    echo "ionice:" `ionice` 1>&2
#fi 

clean_cache_dir()
{
    for subdir in '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' 'a' 'b' 'c' 'd' 'e' 'f'
    do
        find "$1/$subdir" -type f -mmin +$2 -delete 2>/dev/null
        if [ $? -ne 0 ]; then
            find "$1/$subdir" -type f -mmin +$2 2>/dev/null | xargs rm -f
        fi 
        
        # clean directory
        find "$1/$subdir" -empty -delete 2>/dev/null
        if [ $? -ne 0 ]; then
            find "$1/$subdir" -empty 2>/dev/null | xargs rm -rf
        fi
    #fi
    done

}


CUR_DIR=`dirname "$0"`
cd $CUR_DIR
CUR_DIR=`pwd`

find "$CUR_DIR/../../admin/tmp" -type s -atime +1 -delete 2>/dev/null
if [ $? -ne 0 ]; then
    find "$CUR_DIR/../../admin/tmp" -type s -atime +1 2>/dev/null | xargs rm -f
fi 

find "/tmp/lshttpd/swap" -type s -atime +1 -delete 2>/dev/null
if [ $? -ne 0 ]; then
    find "/tmp/lshttpd/swap" -type s -atime +1 2>/dev/null | xargs rm -f
fi 

find "/dev/shm/lsws/ocspcache" -type s -mtime +7 -delete 2>/dev/null
if [ $? -ne 0 ]; then
    find "/dev/shm/lsws/ocspcache" -type s -mtime +7 2>/dev/null | xargs rm -f
fi

#if [ -f '/usr/bin/ionice' ]; then
#    echo "ionice:" `ionice` 1>&2
#fi 
max_age_mins=1440
while [ $# -gt 0 ]
do
    root_dir=$1
    shift
    if [ "x$root_dir" = 'x' ]; then
        exit 1
    fi
    if [ ! -d "$root_dir" ]; then
        exit 2
    fi

    clean_cache_dir "$root_dir" 1440
    clean_cache_dir "$root_dir/priv" 60
    
done

Directory Contents

Dirs: 0 × Files: 31

Name Size Perms Modified Actions
1.17 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
1.82 KB lrwxr-xr-x 2026-04-22 07:01:58
Edit Download
1.82 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
2.06 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
624 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
7.31 KB lr-xr-xr-x 2026-04-17 13:15:13
Edit Download
1.46 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
2.40 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
732 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
22.96 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
336 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
2.68 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
766 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
1.65 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
25 B lrw-r--r-- 2026-04-17 13:15:12
Edit Download
6.43 KB lrw-r--r-- 2026-04-17 13:15:13
Edit Download
272 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
103 B lrw-r--r-- 2026-04-17 13:15:12
Edit Download
15.30 KB lrwxrwxr-x 2026-04-16 23:11:34
Edit Download
660 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
5.65 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
5.65 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
1.78 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
441 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
1.93 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
37.11 KB lrw-r--r-- 2026-04-17 13:15:12
Edit Download
3.23 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
6.24 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
4.61 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
2.90 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
1.85 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).