I found the bug.
cd /vmfs/volumes/datastore2/BACKUP
find . -mindepth 1 -mtime +20 -exec rm -f {} \;
this was the major fault. I didn't make sure I was really in this directory.
So i had the chance to delete every single file from the root directory, which was older than 20 days.
Luckly root user is not real root at all and the machine came back after a cold restart.
This is now the script which "should" work
#variablesset d1=/vmfs/volumes/datastore1/BACKUPset d2=/vmfs/volumes/datastore2/BACKUP#delete backups older than 20 daystest -d "$d2" || mkdir -p "$d2"cd "$d2" && find . -mindepth 1 -mtime +20 -exec rm -f {} \;#change to original dircd "$d1"&& find . \( ! -name "*_1-flat.vmdk" \) | cpio -padvm "$d2/../"
If someone is interessted in the logs just leave me a message!
Thank you all for your effort!