From owner-freebsd-questions@FreeBSD.ORG Thu Jul 8 17:38:26 2004 Return-Path: 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 EB07016A4CE for ; Thu, 8 Jul 2004 17:38:26 +0000 (GMT) Received: from smtp.istop.com (dci.doncaster.on.ca [66.11.168.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 96F5643D41 for ; Thu, 8 Jul 2004 17:38:26 +0000 (GMT) (envelope-from login@istop.com) Received: from istop.com (ns.istop.com [66.11.168.199]) by smtp.istop.com (Postfix) with SMTP id B8F0A17D4F8; Thu, 8 Jul 2004 13:38:25 -0400 (EDT) Date: Thu, 8 Jul 2004 13:38:25 -0400 (EDT) To: From: X-Mailer: TWIG 2.7.6 X-Remote-IP: 67.69.27.58 Message-Id: <20040708173825.B8F0A17D4F8@smtp.istop.com> Subject: Logging user root activities X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2004 17:38:27 -0000 Sysadmins: I am developing a habit of keeping a record what I am doing on the system. The best solution I have come with to run script(1) in the .login file. Here is the line in the .login: /usr/bin/script -q $HOME/adminlog/`last | head -1 | awk '{print $3}'`- `date "+%Y-%m-%d-%Hh-%Mm-%Ss.log"` It create a file ip.add.re.ss-2004-07-08-13h-03m-59s.log in the $HOME/adminlog directory. I guess that I need to know my IP, date and time and activities. This works ok this far. The only thing I can not avoid is to have two times control-D when I need to exit the system as said even in the man of script(1), see below: "The script ends when the forked shell (or command) exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-D (if ignoreeof is not set) for the C-shell, csh(1))." How other admins are doing to have a record of their activities while on the system? I looked on ports in the sysutils and could not find port matching this object. S. Mohammad [login@istop.com]