LoginSignup
6
7

More than 5 years have passed since last update.

linuxの作業ログをとるscriptコマンドを起動時からいれる

Last updated at Posted at 2014-07-11

2014/07/17追記 この方法だとcentosが起動しなくなりました。なので、実施しないでください。原因は調査中です。


基本中の基本かもしれないけど、地味にやっていなかったのでlinuxの作業ログを起動時から全部取得するのをやっておく。

$ mkdir -p /usr/local/dev/script_log
$ chmod 777 /usr/local/dev/script_log
$ sudo su
$ vi /etc/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

# added on 2014/07/11 for logging terminal commands
script /usr/local/dev/script_log/script.log.`date +%Y%m%d%H%M%S`

この最後の二行を追記した。

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7