Events Linux:使用例如entr和mutt创建新文件时发送电子邮件
当在某个目录中创建了扩展名为Events Linux:使用例如entr和mutt创建新文件时发送电子邮件,events,filesystems,mutt,Events,Filesystems,Mutt,当在某个目录中创建了扩展名为.txt的新文件时,我尝试使用以下bash one liner向我发送电子邮件: while sleep 10; do ls *.txt | entr -r -d mutt -s "New file /_" name@mail.com < /dev/null; done 工作 我的第二次尝试是 $ fswatch --event Created -0 -e ".*" -i ".txt" . | xar
.txt
的新文件时,我尝试使用以下bash one liner向我发送电子邮件:
while sleep 10; do ls *.txt | entr -r -d mutt -s "New file /_" name@mail.com < /dev/null; done
工作
我的第二次尝试是
$ fswatch --event Created -0 -e ".*" -i ".txt" . | xargs -0 -n 1 -I {} mutt -s "New file {}" name@mail.com < /dev/null
$ fswatch --event Created -0 -e ".*" -i ".txt" . | xargs -0 -n 1 -I {} mutt -s "New file {}" name@mail.com < /dev/null
$ uname -a
Linux XXX 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux
$ bash --version
GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)