Need help to create a script
by subby80 from LinuxQuestions.org on (#4SKZ6)
Hi,
I need to create a small script which i want to run every night to check if a file is created in a certain directory. If a file is created i need an email message to warn me about it.
I can find the file like this
# find folder -mtime 0 -name "test*" | mail -s 'test' mailadress
But this also sends a message without body. I only want a mail if a file exists.
Thanks


I need to create a small script which i want to run every night to check if a file is created in a certain directory. If a file is created i need an email message to warn me about it.
I can find the file like this
# find folder -mtime 0 -name "test*" | mail -s 'test' mailadress
But this also sends a message without body. I only want a mail if a file exists.
Thanks