I have a crontab that looks something like this:
0 8 * * * command >> mylog.log 2>&1
This appends both errors and standard output into mylog.log.
In addition to what's above, I want to be able to capture only the most recent outputs of command
and send them to my email via:
mail -s 'test' [email protected]
In other words, write all outputs to a log, and send only new outputs to an email.
I read up on tee, and something tells me that may be an answer but I'm not 100% sure on that.