how to truncate the logs without kill memcached

Les Mikesell lesmikesell at gmail.com
Mon Oct 22 21:52:14 UTC 2007


Sheldon Chen wrote:
> I have used memcached -d -m 1024 -vv 2>memcached.log to start the
> memcached and found that the log file memcached.log grows too fast.  Is
> there a way to remove the logs without killing the memcached first?
> 

It is common on unix-like sytems to open/redirect log files in append 
mode (>>) which makes every write have an atomic seek-to-end-of-file. 
This lets you truncate the file (>filename in bash or bourne shell)at 
any time and the next write will start back at the beginning of the file.

-- 
   Les Mikesell
    lesmikesell at gmail.com




More information about the memcached mailing list