File: clear_zk.sh

package info (click to toggle)
python-taskflow 6.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 3,536 kB
  • sloc: python: 27,557; sh: 269; makefile: 24
file content (15 lines) | stat: -rwxr-xr-x 367 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

# This requires https://pypi.org/project/zk_shell/ to be installed...

set -e

ZK_HOSTS=${ZK_HOSTS:-localhost:2181}
TF_PATH=${TF_PATH:-taskflow}

for path in `zk-shell --run-once "ls" $ZK_HOSTS`; do
    if [[ $path == ${TF_PATH}* ]]; then
        echo "Removing (recursively) path \"$path\""
        zk-shell --run-once "rmr $path" $ZK_HOSTS
    fi
done