[packages/php-dirs] use tmpwatch with --test to remove only files matching to 'sess_*' pattern
glen
glen at pld-linux.org
Sat Oct 26 15:37:56 CEST 2013
commit a4756071fea0c8d7a70fa49a5d6c20932785e5aa
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sat Oct 26 16:37:11 2013 +0300
use tmpwatch with --test to remove only files matching to 'sess_*' pattern
NOTE: no LC_ALL, as tmpwatch is not localized (currently at least)
php-session.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/php-session.sh b/php-session.sh
index 309e623..c5d99a2 100755
--- a/php-session.sh
+++ b/php-session.sh
@@ -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
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-dirs.git/commitdiff/a4756071fea0c8d7a70fa49a5d6c20932785e5aa
More information about the pld-cvs-commit
mailing list