zkCleanup.sh 573 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. #
  3. # This script cleans up old transaction logs and snapshots
  4. #
  5. #
  6. # If this scripted is run out of /usr/bin or some other system bin directory
  7. # it should be linked to and not copied. Things like java jar files are found
  8. # relative to the canonical path of this script.
  9. #
  10. ZOOBIN=`readlink -f "$0"`
  11. ZOOBINDIR=`dirname "$ZOOBIN"`
  12. . $ZOOBINDIR/zkEnv.sh
  13. eval `grep -e "^dataDir=" $ZOOCFG`
  14. java "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
  15. -cp $CLASSPATH $JVMFLAGS \
  16. org.apache.zookeeper.server.PurgeTxnLog $dataDir