adam said:
@enricodias4654 if you're saying this isn't happening, i.e. files older than 3 days remain, something in cleanLeftOverChunks() may not be picking them up. Is it on a 'direct' server? There's a double check in the code with _CONFIG_FILE_STORAGE_PATH which may be different on a file server (and should probably be allowed for in the code).
Yes, is on direct servers. I didn't even noticed the function cleanLeftOverChunks, but it still leaves files in the _tmp folder. I just checked the function here and it's just tries to remove files from the _tmp folder and not from the _deleted folder.
I think it doesn't work because it's using filemtime to check the file modification time. I had similar issue when I was checking the file creation time in the cronjob, some files was still being left there and using "ctime" solved it. Maybe your function would work using filectime instead of filemtime. Also, results of those functions are cached so you may want to use the function clearstatcache just to be sure.
In some Unix filesystems a file is considered changed when its inode data is changed; that is, when the permissions, owner, group, or other metadata from the inode is updated. filectime will check the inode.
Anyway, it's simpler to just use a cronjob.
regioserver said:
Thanks for your answer! helps good
So, Adam does the script include this Cronjob to delete those garbage files?
Regards
Those are the cronjobs that I use:
find httpdocs/files/_tmp/* -type f -ctime +3 -delete
find httpdocs/files/_deleted/* -type f -ctime +3 -delete
I run them 1x every night.