1. sudo apt-get install inotify-tools -y
    2. while inotifywait -e modify,create,delete,move /etc/cron.d; do
    3. echo "file:?"
    4. done
    5. while read -r directory events filename; do
    6. echo "$directory $events $filename"
    7. done < <(inotifywait -m -e modify,create,delete,move -q -r /etc/cron.d)
    1. while inotifywait -e create,modify,move,delete -q -r /etc/cron.d; do
    2. echo "file:?"
    3. done
    1. while read -r _directory _events _filename; do
    2. echo "$_directory $_events $_filename"
    3. done < <(inotifywait -e create,modify,move,delete -q -r /etc/cron.d)
    1. inotifywait -e create,modify,move,delete -q -r /etc/cron.d | while read -r _directory _events _filename; do
    2. _current_time=$(date +%s.%N)
    3. if [[ -z "${_last_time:-}" || $(echo "$_current_time - $_last_time > 0.1" | bc -l) -eq 1 ]]; then
    4. echo "$_directory $_events $_filename"
    5. _last_time=$_current_time
    6. fi
    7. done