Skip to content

Instantly share code, notes, and snippets.

@petasittek
Created October 17, 2011 07:40
Show Gist options
  • Save petasittek/1292143 to your computer and use it in GitHub Desktop.
Save petasittek/1292143 to your computer and use it in GitHub Desktop.
Save cron output to file with a timestamp in its filename
# do not forget to escape % to \% in date's parameter
* * * * * /usr/bin/php /path/script.php > /var/log/output-`date +\%Y\%m\%d\%H\%M`.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment