Many thanks! Same change done to dietpi-backup
and merged.
EDIT: I just now re-read and understood the purpose of the grep
in your example above. It would require to check for the $PPID
(parent shell/script process ID) instead, since pgrep
prints the PIDs of matching processes, instead of their names. But I think it should be fine when checking for the exact match via -x
only, since likely/hopefully no one calls its script exactly rsync
.