Current Path : /usr/lib64/php5/ |
Current File : //usr/lib64/php5/sessionclean |
#!/bin/sh # first find all used files and touch them (hope it's not massive amount of files) lsof -w -l +d "${1}" | awk -- '{ if (NR > 1) { print $9; } }' | xargs -i touch -c {} # find all files older then maxlifetime find "${1}" -ignore_readdir_race -depth -mindepth 1 -maxdepth 1 -type f -cmin +${2} -delete