Skip to content

Instantly share code, notes, and snippets.

@schmkr
Created August 25, 2014 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schmkr/c62ecb759422a3ce72ee to your computer and use it in GitHub Desktop.
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.
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