-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- implement post kill cleanup based on plotid wildcard search
through dst/tmp/tmp2 dirs (#582,...)
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/plotman/resources/hooks.d/99-post-kill-cleanup.sh.example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
. ${PLOTMAN_HOOKS}/.lib.include | ||
|
||
[ "${PLOTMAN_TRIGGER}" = "KILL" ] || exit 0 | ||
|
||
logInfo "${PLOTMAN_TRIGGER} triggered processing plot id ${PLOTMAN_PLOTID} (ph: ${PLOTMAN_PHASE})" | ||
|
||
for d in "${PLOTMAN_DSTDIR}" "${PLOTMAN_TMPDIR}" "${PLOTMAN_TMP2DIR}"; do | ||
|
||
### avoid using find, grep, xargs - all those can be various implementations | ||
### behaving differently for corner cases like spaces in file name, or can | ||
### implement different set of arguments (POSIX vs BSD variants, busybox, ....) | ||
### so do it the legacy way | ||
ls "${d}/"*${PLOTMAN_PLOTID}* | while read f; do | ||
rm -v "$f" | ||
done | ||
done | ||
|