Created
August 25, 2014 15:05
-
-
Save schmkr/c62ecb759422a3ce72ee to your computer and use it in GitHub Desktop.
An example of how to get the output of a cronjob to go to both STDOUT (so it can be emailed to MAILTO) and logged to a file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 0 * * * sh script.sh 2>&1 | tee -a /var/log/script.`date +\%Y\%m\%d`.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment