From owner-freebsd-questions@FreeBSD.ORG Thu May 26 11:44:55 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AFC016A41C for ; Thu, 26 May 2005 11:44:55 +0000 (GMT) (envelope-from ehazegers@mail.com) Received: from webmail-outgoing.us4.outblaze.com (webmail-outgoing.us4.outblaze.com [205.158.62.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 67C3E43D1F for ; Thu, 26 May 2005 11:44:55 +0000 (GMT) (envelope-from ehazegers@mail.com) Received: from unknown (unknown [192.168.9.180]) by webmail-outgoing.us4.outblaze.com (Postfix) with QMQP id 26C7C1800136 for ; Thu, 26 May 2005 11:44:55 +0000 (GMT) X-OB-Received: from unknown (205.158.62.51) by wfilter.us4.outblaze.com; 26 May 2005 11:44:55 -0000 Received: by ws1-5.us4.outblaze.com (Postfix, from userid 1001) id 1D5BF6EEF6; Thu, 26 May 2005 11:44:55 +0000 (GMT) Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-Mailer: MIME::Lite 2.117 (F2.6; A1.17; B2.12; Q2.03) Received: from [218.132.80.147] by ws1-5.us4.outblaze.com with http for ehazegers@mail.com; Thu, 26 May 2005 06:44:55 -0500 X-Mailer: mail.com webmail From: "Eugene Zegers" To: freebsd-questions@freebsd.org Date: Thu, 26 May 2005 06:44:55 -0500 X-Originating-Ip: 218.132.80.147 X-Originating-Server: ws1-5.us4.outblaze.com Message-Id: <20050526114455.1D5BF6EEF6@ws1-5.us4.outblaze.com> Subject: Logout procedure: Where to call own script? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2005 11:44:55 -0000 Hi, In order to log the logintime for a person on a certain PC running FreeBSD = 5.3, I want to call a "logout procedure" when the person logs out (either out of= Gnome or with a shutdown) as follow: last -y -t ttyv0 | awk '{print $1,$4,$5,$6,$9}' | loginperiod >> /home/user= //Test.log where loginperiod is a tested Perl script which will give the required outp= ut. However, the total logintime is written in /var/log/wtmp during the logout = process. Just after that moment, I want to call my script, using the command sequence above, an= d seperately log the time in /home of the user (or like: _Timesheet.log instead of Test.log). I have tried to call this script in /etc/rc.shutdown, but it only creates T= est.log as an empty file (the command above will give an output like: