Return-Path: X-Original-To: apmail-community-commits-archive@minotaur.apache.org Delivered-To: apmail-community-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7925F17836 for ; Wed, 7 Oct 2015 12:19:26 +0000 (UTC) Received: (qmail 49562 invoked by uid 500); 7 Oct 2015 12:19:26 -0000 Delivered-To: apmail-community-commits-archive@community.apache.org Received: (qmail 49536 invoked by uid 500); 7 Oct 2015 12:19:26 -0000 Mailing-List: contact commits-help@community.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@community.apache.org Delivered-To: mailing list commits@community.apache.org Received: (qmail 49525 invoked by uid 99); 7 Oct 2015 12:19:26 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Oct 2015 12:19:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id DAE65C41E6 for ; Wed, 7 Oct 2015 12:19:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id fOr10GupxWrP for ; Wed, 7 Oct 2015 12:19:16 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 946CE204C8 for ; Wed, 7 Oct 2015 12:19:15 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 88131E0256 for ; Wed, 7 Oct 2015 12:19:14 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id EBBAB3A01E3 for ; Wed, 7 Oct 2015 12:19:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1707272 - /comdev/projects.apache.org/scripts/cronjobs/python3logger.sh Date: Wed, 07 Oct 2015 12:19:13 -0000 To: commits@community.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151007121913.EBBAB3A01E3@svn01-us-west.apache.org> Author: sebb Date: Wed Oct 7 12:19:13 2015 New Revision: 1707272 URL: http://svn.apache.org/viewvc?rev=1707272&view=rev Log: Initial try at logging python3 output Added: comdev/projects.apache.org/scripts/cronjobs/python3logger.sh (with props) Added: comdev/projects.apache.org/scripts/cronjobs/python3logger.sh URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/python3logger.sh?rev=1707272&view=auto ============================================================================== --- comdev/projects.apache.org/scripts/cronjobs/python3logger.sh (added) +++ comdev/projects.apache.org/scripts/cronjobs/python3logger.sh Wed Oct 7 12:19:13 2015 @@ -0,0 +1,26 @@ +# Script to redirect standard output of a python3 script to /var/log/www-data + +# Output log file is named after the script file name plus the suffix _YYYY-MM +# This ensures that at most one month's data is in each log file + +# Sample usage: +# cd .../scripts/cronjobs && ./python3logger.sh parsepmcs.py + +SCRIPT=${1?Script name} + +LOGDIR=/var/log/www-data + +BASE=$(basename $SCRIPT .py) + +YYMM=$(date '+%Y-%m') + +exec >>${LOGDIR}/${BASE}_${YYMM}.log +echo +echo '>>>' +echo Starting $SCRIPT at $(date) +export + +python3 -u $SCRIPT + +echo Completed $SCRIPT at $(date) +echo '<<<' Propchange: comdev/projects.apache.org/scripts/cronjobs/python3logger.sh ------------------------------------------------------------------------------ svn:eol-style = native Propchange: comdev/projects.apache.org/scripts/cronjobs/python3logger.sh ------------------------------------------------------------------------------ svn:executable = *