The following is a shell script that clears three zookeeper nodes (making it a scheduled task): zookeeper home Zkdir=/server/app/zookeeper-3.4.6 snapshot file dir snapDir=/mnt/data/zookeeper/n_1 snapDir2=/mnt/data/zookeeper/n_2 snapDir3=/mnt/data/zookeeper/n_3 tran log dir dataDir=/mnt/data/zookeeper/n_1 dataDir2=/mnt/data/zookeeper/n_2 dataDir3=/mnt/data/zookeeper/n_3 Leave 30 files Count=15 Cd /server/app/zookeeper-3.4.6 Java -cp ${zkdir}/zookeeper-3.4.6.jar:${zkdir}/lib/slf4j-api-1.6.1.jar:${zkdir}/lib/slf4j-log4j12-1.6.1.jar: ${zkdir}/lib/log4j-1.2.16.jar:${zkdir}/conf org.apache.zookeeper.server.PurgeTxnLog ${dataDir} ${snapDir} -n ${count} Java -cp ${zkdir}/zookeeper-3.4.6.jar:${zkdir}/lib/slf4j-api-1.6.1.jar:${zkdir}/lib/slf4j-log4j12-1.6.1.jar: ${zkdir}/lib/log4j-1.2.16.jar:${zkdir}/conf org.apache.zookeeper.server.PurgeTxnLog ${dataDir2} ${snapDir2} -n ${count} […]