Anyone got a quick code snippet I can add to my crontab? Since Rails
doesn’t do any housekeeping, my /tmp directory just keeps getting fatter
and fatter. I found this useless snippet in the Agile book:
find /tmp/ -name ‘ruby_sess*’ -ctime +12h -delete
Fedora Linux complains about the ‘h’ in 12h, then if you remove the ‘h’
he complains about the ‘-delete’ part too which doesn’t even seem to
exist in the man page for find.
On Sat, Dec 17, 2005 at 06:22:52AM +0100, Sean S. wrote:
Anyone got a quick code snippet I can add to my crontab? Since Rails
doesn’t do any housekeeping, my /tmp directory just keeps getting fatter
and fatter. I found this useless snippet in the Agile book:
find /tmp/ -name ‘ruby_sess*’ -ctime +12h -delete
Fedora Linux complains about the ‘h’ in 12h, then if you remove the ‘h’
I get a similar warning with the find in Ubuntu Breezy (4.2.22).
Considering that version was released from the GNU project (according to
it’s timestamp in the FTP directory) in June, I’m curious as to what
version
of find was being used in the Rails book.
he complains about the ‘-delete’ part too which doesn’t even seem to
exist in the man page for find.
This option exists in my manpage, and seems to work fine. I suspect
Fedora’s find may be a little out of date.
Considering that version was released from the GNU project (according to
it’s timestamp in the FTP directory) in June, I’m curious as to what version
of find was being used in the Rails book.
The screenshots in the book give it away; it was most likely a version
of
find for BSD (the screenshots indicate that the authors like Macs).
On Sat, Dec 17, 2005 at 10:33:39AM -0500, Graham Ashton wrote:
On Saturday 17 December, Matthew P. wrote:
Considering that version was released from the GNU project (according to
it’s timestamp in the FTP directory) in June, I’m curious as to what version
of find was being used in the Rails book.
The screenshots in the book give it away; it was most likely a version of
find for BSD (the screenshots indicate that the authors like Macs).
An excellent point, and one that I hadn’t considered. Makes perfect
sense,
too. Time to file a bug report on GNU find to add the multiplier
suffixes.
On Sat, Dec 17, 2005 at 06:22:52AM +0100, Sean S. wrote:
Anyone got a quick code snippet I can add to my crontab? Since Rails
doesn’t do any housekeeping, my /tmp directory just keeps getting fatter
and fatter. I found this useless snippet in the Agile book:
find /tmp/ -name ‘ruby_sess*’ -ctime +12h -delete
Fedora Linux complains about the ‘h’ in 12h, then if you remove the ‘h’
I get a similar warning with the find in Ubuntu Breezy (4.2.22).
Considering that version was released from the GNU project (according to
it’s timestamp in the FTP directory) in June, I’m curious as to what
version
of find was being used in the Rails book.
he complains about the ‘-delete’ part too which doesn’t even seem to
exist in the man page for find.
This option exists in my manpage, and seems to work fine. I suspect
Fedora’s find may be a little out of date.
Wouldn’t you want to use -amin instead of -cmin? (access vs. created)
In other words, you probably want to delete stale session files that
haven’t been used in a while rather than just deleting files that were
created a while ago. Otherwise you risk dumping people’s sessions who
frequent the site out from under them while they are in use.