Skip to content

Instantly share code, notes, and snippets.

@killpond
Created June 5, 2015 13:45
Show Gist options
  • Save killpond/bccc517344dee659ea99 to your computer and use it in GitHub Desktop.
Save killpond/bccc517344dee659ea99 to your computer and use it in GitHub Desktop.
Check magento session file usage
# Find all the session files older then 3 days then display the number of files.
find /path/to/your/website/root/var/session -name 'sess_*' -type f -mtime +3 | wc -l
# Same as above, but display them in "less", browse with PageUP / PageDown.
find /path/to/your/website/root/var/session -name 'sess_*' -type f -mtime +3 | less
# Delete all the files older then 3 days.
find /path/to/your/website/root/var/session -name 'sess_*' -type f -mtime +3 -exec rm {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment