## org.apache.zookeeper.server
Class PurgeTxnLog

    java.lang.Object
      org.apache.zookeeper.server.PurgeTxnLog

    public class PurgeTxnLog

extends Object

this class is used to clean up the snapshot and data log dir's. This is usually run as a cronjob on the zookeeper server machine. Invocation of this class will clean up the datalogdir files and snapdir files keeping the last "-n" snapshot files and the corresponding logs.

Constructor Summary
`PurgeTxnLog()`

Method Summary
`static void` `main(String[] args)`
`static void` `purge(File dataDir, File snapDir, int num)` purges the snapshot and logs keeping the last num snapshots and the corresponding logs.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PurgeTxnLog

    public PurgeTxnLog()

Method Detail

### purge

    public static void purge(File dataDir,
                             File snapDir,
                             int num)
                      throws IOException

  purges the snapshot and logs keeping the last num snapshots and the corresponding logs.

  Parameters:
    `dataDir` - the dir that has the logs
    `snapDir` - the dir that has the snapshots
    `num` - the number of snapshots to keep
  Throws:
    `IOException`

### main

    public static void main(String[] args)
                     throws IOException

  Parameters:
    `args` - PurgeTxnLog dataLogDir dataLogDir -- txn log directory -n num (number of snapshots to keep)
  Throws:
    `IOException`

Copyright © 2012 The Apache Software Foundation