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