Please, can you help me with a script that counts something (wc -l) and when the count is below 3 the script emails me.
Thank you!
Please, can you help me with a script that counts something (wc -l) and when the count is below 3 the script emails me.
Thank you!
Find
andwc -l
return the count of files and then[[
evaluates if the count is lees than three. If this evaluates to true and returns zero exit status, next command after&&
is executed.If the mail environment is set up correctly, mail with given subject and message will be sent.