#!/bin/bash # ! Не используйте это, если не понимаете, как оно работает. apt update -y && apt install -y inotify-tools && apt clean inotifywait -m /build/iso -e close_write | while read path action file; do echo "The file '$file' appeared in directory '$path' via '$action'" if [ $action != "CREATE,ISDIR" ]; then xhost + >/dev/null 2>/dev/null #find $path ! -name "$file" -type f -exec rm -f {""} + cp $path$file /mnt/build/iso/minios.iso mv $path$file /mnt/build/iso/ fi done