From owner-freebsd-questions Fri Apr 5 14: 4: 4 2002 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id D085837B417 for ; Fri, 5 Apr 2002 14:03:58 -0800 (PST) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.12.2/8.12.2) with ESMTP id g35M3omG042950; Fri, 5 Apr 2002 16:03:52 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.2/8.12.2/Submit) id g35M3oAq042949; Fri, 5 Apr 2002 16:03:50 -0600 (CST) Date: Fri, 5 Apr 2002 16:03:50 -0600 From: Dan Nelson To: Rick.Robinson@bankofamerica.com Cc: questions@FreeBSD.ORG Subject: Re: AT Logging Question Message-ID: <20020405220350.GO75339@dan.emsphone.com> References: <86256B92.00752289.00@notes.bankofamerica.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86256B92.00752289.00@notes.bankofamerica.com> User-Agent: Mutt/1.3.28i X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Apr 05), Rick.Robinson@bankofamerica.com said: > Is there any logging kept from jobs that are run from at or batch? It doesn't look like it. Completed jobs do hang around in /var/at/jobs for 5 minutes (the next atrun cleans them), though, so the poor mans's solution would be to change the atrun line in /etc/crontab to read */5 * * * * root /usr/libexec/atrun ; atq -v | grep '(done)' | logger -p cron.notice -t atrun , which would log the fact that a job was run, but no more infomartion than that: Apr 5 15:59:18 <9.5> dan atrun: Fri Apr 5 15:56:00 CST 2002 root c(done) 9 Doing real cron-style logging is not that simple, because the input to at/batch could be a large script, so what would you log? If you just want to log (say) the first 80 chars of the command, it would be pretty easy to add to atrun, so /var/log/cron would look like: Apr 5 15:35:00 <9.6> dan /usr/sbin/cron[93683]: (root) CMD (/usr/libexec/atrun) Apr 5 15:35:00 <9.6> dan /usr/libexec/atrun[93684]: (user1) CMD (echo hi) Apr 5 15:35:00 <9.6> dan /usr/libexec/atrun[93685]: (user2) CMD (echo test job) -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message