summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2025-07-07 16:56:21 +0200
committerChristian Schneider2025-07-07 16:56:21 +0200
commit90ce3f5d377259825e68aee4e2a5508380a17e9c (patch)
tree1912676af875880293cf0fcd4dad2f95f9f25b2d
parent0f78133d8d335753cbd9e0d2d7ab91f64f931113 (diff)
downloaditools-90ce3f5d377259825e68aee4e2a5508380a17e9c.tar.gz
itools-90ce3f5d377259825e68aee4e2a5508380a17e9c.tar.bz2
itools-90ce3f5d377259825e68aee4e2a5508380a17e9c.zip
Store urlcache directoy maxage (in minutes) in 'cleaned' file for daily cleanup job
-rw-r--r--it_url.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_url.class b/it_url.class
index c814261..7321d06 100644
--- a/it_url.class
+++ b/it_url.class
@@ -708,8 +708,8 @@ static function get_cache($p = array())
$isnight = date('H') >= 1 && date('H')*3600 + date('i')*60 < $p['cleanbefore'];
if (time() - @filemtime($p['cachedir'] . "/cleaned") > ($isnight ? 80000 : 2*80000))
{
- it::file_put($p['cachedir'] . "/cleaned", ""); # touch could have permission problems
$maxagemin = intval($p['maxage']/60);
+ it::file_put($p['cachedir'] . "/cleaned", "$maxagemin\n");
exec("nohup bash -c 'cd {$p['cachedir']} && for i in [0-9a-f][0-9a-f]; do sleep 20; ionice -c 3 find \$i -mmin +$maxagemin -type f -delete; done' </dev/null >/dev/null 2>&1 &");
}