Skip to content

Commit 82e22b6

Browse files
committed
- implement post kill cleanup based on plotid wildcard search
through dst/tmp/tmp2 dirs (#582,...)
1 parent f8e7880 commit 82e22b6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
. ${PLOTMAN_HOOKS}/.lib.include
4+
5+
[ "${PLOTMAN_TRIGGER}" = "KILL" ] || exit 0
6+
7+
logInfo "${PLOTMAN_TRIGGER} triggered processing plot id ${PLOTMAN_PLOTID} (ph: ${PLOTMAN_PHASE})"
8+
9+
for d in "${PLOTMAN_DSTDIR}" "${PLOTMAN_TMPDIR}" "${PLOTMAN_TMP2DIR}"; do
10+
11+
### avoid using find, grep, xargs - all those can be various implementations
12+
### behaving differently for corner cases like spaces in file name, or can
13+
### implement different set of arguments (POSIX vs BSD variants, busybox, ....)
14+
### so do it the legacy way
15+
ls "${d}/"*${PLOTMAN_PLOTID}* | while read f; do
16+
rm -v "$f"
17+
done
18+
done
19+

0 commit comments

Comments
 (0)