aboutsummaryrefslogtreecommitdiffstats
path: root/backuper.sh
diff options
context:
space:
mode:
Diffstat (limited to 'backuper.sh')
-rw-r--r--backuper.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/backuper.sh b/backuper.sh
index 9324b0c..95e3c25 100644
--- a/backuper.sh
+++ b/backuper.sh
@@ -148,11 +148,13 @@ error_handler() {
cleanup() {
trap - EXIT INT QUIT TERM HUP ILL TRAP BUS FPE SEGV
- for PID in $(cat "$RUNDIR"/"$PID_FILE"); do
- if ps --ppid $$ | grep -q "$PID"; then
- kill "$PID"
- fi
- done
+ if [ -f "$RUNDIR"/"$PID_FILE" ]; then
+ for PID in $(cat "$RUNDIR"/"$PID_FILE"); do
+ if ps --ppid $$ | grep -q "$PID"; then
+ kill "$PID"
+ fi
+ done
+ fi
[ -n "$PID_GENERATE" ] && if ps --ppid $$ | grep -q "$PID_GENERATE"; then
kill "$PID_GENERATE"