From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B44DA138202 for ; Wed, 12 Dec 2012 03:16:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0DB7721C057; Wed, 12 Dec 2012 03:15:52 +0000 (UTC) Received: from mail2.viabit.com (mail2.viabit.com [65.246.80.16]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7B82D21C009 for ; Wed, 12 Dec 2012 03:14:43 +0000 (UTC) Received: from [172.17.29.6] (vpn1.metro-data.com [65.213.236.242]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail2.viabit.com (Postfix) with ESMTPSA id 3YLjmw3562z1hfM for ; Tue, 11 Dec 2012 22:14:39 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=orlitzky.com; s=mail2; t=1355282081; bh=tvS0qdaor4/N5nBxhkqhvT707Q644DWc5w83VMYWMKE=; h=Date:From:To:Subject:References:In-Reply-To; b=XAjm28s989AIYUYD0Kir6mAjWiql8XdBJYejkcgDr7KwufaUAx7e7mpzvKL6snEq1 Tbk4GJ7D7MyolRkS9usmpp69H67GkOZorEvdyjy/1qSx5B2g2cxfPtfvTSc0EYsPoa hbWHjlbRka7MLxK/KPDZ1XBEWH6kj1gyWF0pv8sg= Message-ID: <50C7F69B.6080100@orlitzky.com> Date: Tue, 11 Dec 2012 22:14:35 -0500 From: Michael Orlitzky User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.10) Gecko/20121104 Thunderbird/10.0.10 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] crontab questions References: In-Reply-To: X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 48a13fc1-1597-4993-b9be-fa1a15cf3876 X-Archives-Hash: 9da355ea64e49a50a16026eaf169e989 On 12/11/2012 04:15 PM, Grant wrote: > Is there a way to remove "Cron " from the subject line of > crontab mail without piping each cron job to 'mail'? > > I set 'usermod -c hostname root' on each of my systems so that the From: > line displays "hostname" for crontab mail. This works on each system > except the mail server itself which still shows "Cron Daemon". Can > crontab mail from the mail server be made to display From: "hostname" > like the other systems? > > I'm not completely clear on how cronbase works. Can this crontab be > integrated into the system crontab via cronbase or should it be run as a > separate user crontab for root? > > 0 4 * * * layman -NS && eix-sync -n && eix-remote update -n > 15 4 * * * emerge -pvDuN world > 20 4 * * * eclean -C distfiles > 30 4 * * * eclean -C packages > 40 4 * * * eix-test-obsolete > 45 4 * * * revdep-rebuild -ip > If your goal is to run these each one after the other, you can simply stick a shell script in /etc/cron.daily that executes them in order. The default crontab runs any executable files in, * /etc/cron.daily * /etc/cron.hourly * /etc/cron.monthly * /etc/cron.weekly at roughly the time specified in /etc/crontab. If any of those directories contain scripts, they're run in "alphabetical" order, i.e. how `ls` would sort them. To fix the Subject/From headers, try, http://www.postfix.org/header_checks.5.html I've never had to use them myself, but I think the REPLACE action will do what you want. The alternative is to replace the sendmail binary with something that executes e.g., sed -e 's/Subject: Cron <[^>]> /Subject: /g' | /the/actual/sendmail Both feel a little dirty, but the header checks are less likely to break something assuming that they will work on a client-provided From header.