I have over 5 million session files in /var/lib/php5
I would like to delete all files in this folder using rm *
, however I'm not sure if there are other files other than the session files in that directory that should not be deleted.
Through SSH it took a few minutes to make the file count and I'm not sure I can navigate through there with all these random filenames.
The setup is ubuntu lucid linx, apache 2 and php5. In the most common of setups are there other folders / files in /var/lib/php5
that I should not delete?
Edit The reason I want to remove the files is because I moved session handling to a database and don't need any of the files anymore.
If you use file driver for session, just remove those files in storage/framework/sessions . In config/session. php you can find lifetime , default it's set for 2 hours. After 2 hours it's automatically removed.
PHP Session Start By default, session data is stored in the server's /tmp directory in files that are named sess_ followed by a unique alphanumeric string (the session identifier).
cd /var/lib/php5
find . -name "sess_*" -print | xargs rm -v
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With