I'm running Magento and it doesn't clean up old session data, so I need to clean it up with a shell script / cronjob:
0,30 * * * * /usr/bin/find /var/www/magento/var/session -name 'sess_*' -type f -mtime +1 -exec rm {} \;
But that script takes usually some minutes to delete the old files. I'm wondering whether I need to search for the files since in this directory are only files that start with "sess_" - but I still need to traverse those files somehow, right?
(around 50.000 files per day are created in this directory)
\;for-- {} +at the end. I think it should drastically improve execution time.-deleteeven better thanexec rm {} \;?find--execis portable,-deleteis an extension. In my opinion, anything scripted should eschew extensions when practically possible.