在这种情况下,我如何捕获 inotifywait 的输出,这让我发疯。
这是我的代码:
while inotifywait -q -e create,delete --format '%T %:e "%f"' --timefmt '%d/%m/%y %H:%M' "$DIR"
do
echo -e "$line" >> /mnt/pidrive1/Digital_Signage/log/"$hostname"_sync.log
echo -e "Folder contents:" $file_number "files in total: " $folder_list >> /mnt/pidrive1/Digital_Signage/log/"$hostname"_sync.log
done