Sometimes my server does not restart or shutdown and after a while I found out that still running backup scripts caused this issue. Because of that I created the "stop" file which is automatically executed by Unraid:
touch /boot/config/stop
and pasted the following content:
#!/bin/bash
# -------------------------------------------------
# Kill all processes which prevent shutdown
# -------------------------------------------------
while [ $(pkill -xc rsync) != "0" ]; do logger -