I'm thinking of using cron and reading the files' dates
That's exactly what I do. Works like a charm.
Sample code:
my $tmp_path = "/tmp/myapp"; my $max_age = 60*60*24; # e.g. one day my $t_keep = time() - $max_age; my @stale_sessfiles = grep { (stat $_)[9] < $t_keep } # files older than $t_keep glob "$tmp_path/cgisess_*"; # print STDERR "$_\n" for @stale_sessfiles; # debug unlink @stale_sessfiles;
In reply to Re: Suggestions on cleaning up session files
by almut
in thread Suggestions on cleaning up session files
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |