Hi Folks,
Just a quick question about matrix session files. It appears to us that Matrix does not garbage clean the session files stored in the <matrix_root>/cache directory.
We are copy the matrix install to another server and noticed this large amount of what appears to be dead session files. Can someone please confirm that they are OK to delete (which is what we think). And comment on whether or not matrix cleans these up .
Many Thanks,
Anthony
There is a session_cleanup.sh script in the scripts/ folder that cleans out old session files. You can run that regularly via cron. 
If you are running 3.8.5 onwards you should be running the session files garbage script via cron, as described at the bottom of the installation instructions.
Edit: what Avi wrote 
[quote]If you are running 3.8.5 onwards you should be running the session files garbage script via cron, as described at the bottom of the installation instructions.
Edit: what Avi wrote 
[right][post=“13592”]<{POST_SNAPBACK}>[/post][/right][/quote]
Great that saves us writting one…
A
[quote]Great that saves us writting one…
A
[right][post=“13593”]<{POST_SNAPBACK}>[/post][/right][/quote]
Folks,
WHat is the expected output of this script. As far as I can tell the srcript is not giving me any feedback on what it thinks it has done (I just get a new prompt when it is finished). And it does not appear to have removed any session files from the <matrix_home>/cache directory…
Thanks,
A
The script will clean-up session files based on your session timeout rules. Make sure you don't have settings in the global prefs like "keep sessions active for 5 days" or something like that.
when we put our 3.18.3 session_cleanup.sh in cron we get error message:
"You must pass the system root of a MySource Matrix installation as the first argument to this script"
should the installation instructions read:
0 0 * * * '/home/websites/mysource_matrix/scripts/session_cleanup.sh /home/websites/mysource_matrix'
not sure about the quote mark for shell scripts though - could be ` ' but probably not " ?
am i the only one to get this error? it was sent via email from the apache server process.
There should be no quotes in the crontab.
fair enough - but the bigger issue is should the argument for the system root be there and if so then the installation documentation needs to be updated?
The Matrix system root directory is a required argument. The error described is thrown when either the directory has not been specified, or when the specified directory does not exist.
i get that but this section of the installation page will need amending:
[quote]For v3.8.5 onwards an entry is also required for the session files garbage collection script:
0 0 * * * /home/websites/mysource_matrix/scripts/session_cleanup.sh[/quote]
http://matrix.squiz.net/resources/installation
[quote]i get that but this section of the installation page will need amending:
http://matrix.squiz.net/resources/installation[/quote]
Sorry for the misunderstanding.
I have amended the Matrix Installation Guide accordingly. Thanks for letting us know.