]> git.pld-linux.org Git - packages/php-dirs.git/commitdiff
use tmpwatch with --test to remove only files matching to 'sess_*' pattern
authorElan Ruusamäe <glen@delfi.ee>
Sat, 26 Oct 2013 13:37:11 +0000 (16:37 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sat, 26 Oct 2013 13:37:11 +0000 (16:37 +0300)
NOTE: no LC_ALL, as tmpwatch is not localized (currently at least)

php-session.sh

index 309e62331facb6cad5d6b2334ee3a5518ea96758..c5d99a27aa76de883ded55b94101f73fd45185a1 100755 (executable)
@@ -20,4 +20,12 @@ for php in php php4 php52 php53 php54 php55; do
 done
 
 [ $gc_time -gt 0 ] || exit 0
-/usr/sbin/tmpwatch $gc_time $session_dir
+
+# use tmpwatch with --test to remove only files matching to 'sess_*' pattern
+/usr/sbin/tmpwatch $gc_time $session_dir --test | while read action type file; do
+       case "$action $type $file" in
+       'removing file '*/sess_*)
+               rm "$file"
+               ;;
+       esac
+done
This page took 0.479328 seconds and 4 git commands to generate.