Forum: Ruby on Rails session temp files?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
46fa933af973ed7e149737c9efecb429?d=identicon&s=25 Gary Huntress (Guest)
on 2005-12-18 17:16
(Received via mailing list)
I'm running a simple WEBrick server for a small rails website.   I
probably
get less than 100 hits per hour.  I just looked in /tmp on the server
and
there are over 10,000 ruby_sess.* temp files containing:

"       hash{"
flashIC:'ActionController::Flash::FlashHash{:
@used{

They've piled up so much that I can't even rm -f ruby*.   Bash complains
"argument list too long"

How do people typically clean these up?    A cron job?  Can they all be
safely deleted or should I only delete "older than...." files?

Thanks,

Gary
Ce60c4f78a63b0695e4dafc4bd7964f7?d=identicon&s=25 Lou Vanek (Guest)
on 2005-12-18 18:07
(Received via mailing list)
to delete session files older than 120 minutes, you might try,

   find /dir/to/clean -type f -iname "ruby_sess*" -cmin +120 -exec rm {}
\;

for a low-volume site i would continue to use pstore, and run a cron job
to
periodically clean.

if the excess files are bothersome, you could always change to a
different
store,
   http://wiki.rubyonrails.com/rails/pages/MemCached/versions/1
or ActiveRecordStore,
   http://railswiki.pdxruby.org/HowtoChangeSessionStore.html
among others.
This topic is locked and can not be replied to.