linux系统日志,screen工具
来源:互联网 发布:php 调用父类属性 编辑:程序博客网 时间:2024/05/14 07:32
/var/log/messages是系统总日志,包含系统,运行时的消息状态,网络错误都会记录到这个文件中。他会隔一段时间自动切割(logrotate)。
[root@shuai-01 ~]# ls /var/log/messages*/var/log/messages /var/log/messages-20171128/var/log/messages-20171113 /var/log/messages-20171203/var/log/messages-20171120
logrotate自动切割日志,配置文件(/etc/logrotate.conf)
[root@shuai-01 ~]# cat /etc/logrotate.conf# see "man logrotate" for details# rotate log files weeklyweekly //每周切割# keep 4 weeks worth of backlogsrotate 4 //保留4个# create new (empty) log files after rotating old onescreate //创建新文件# use date as a suffix of the rotated filedateext //后缀名# uncomment this if you want your log files compressed#compress //压缩# RPM packages drop log rotation information into this directoryinclude /etc/logrotate.d //其他配置文件 # no packages own wtmp and btmp -- we'll rotate them here/var/log/wtmp { monthly create 0664 root utmp minsize 1M rotate 1}/var/log/btmp { missingok monthly create 0600 root utmp rotate 1}# system-specific logs may be also be configured here.
命令:dmesg
作用:显示系统启动信息
查看登录系统的信息:
命令:last
调用日志文件:/var/log/wtmp
查看登录时的详细信息,登录日期,时长,终端,账户名
命令:lastb
调用日志文件:/var/log/btmp
显示账户登录失败的信息
screen工具
执行一个脚本,需要它连续不间断运行。加上&,将脚本放在后台运行,但是退出终端时,脚本也可能会退出。这时有两种方法,一种是nohup运行脚本,一种是screen工具。
1. 使用nohup
运行脚本时前面加上
nohup sh /usr/local/sbin/sleep.sh &
2.screen工具
screen类似于一个虚拟终端。
安装screen命令:
[root@shuai-01 ~]# yum install -y screen
直接运行screen进入虚拟终端
运行脚本,
退出screen(Ctrl+a ,在按d)
在虚拟终端下结束(exit)
查看以打开的screen会话:screen -ls
打开某个screen会话:screen -r ID
给虚拟终端创建时起个名字:screen -S “test_screen”
阅读全文
0 0
- linux系统日志,screen工具
- rsync通过服务同步、linux系统日志和screen工具
- day 38 Linux系统日志与screen工具
- linux日志和screen工具
- Linux学习第三十四篇:rsync通过服务同步,Linux系统日志,screen工具
- 日常运维(八):sync通过服务同步,linux系统日志,screen工具
- 八周第三次课 2017.12.6 rsync通过服务同步、linux系统日志、screen工具
- 171206 8周3次课 rsync通过服务同步、linux系统日志、screen工具
- linux screen打印日志
- Linux screen 工具使用
- linux screen 工具笔记
- Linux screen工具使用教程
- linux screen工具的使用
- Linux下的screen工具
- Linux Screen技巧:记录屏幕日志
- linux命令行工具-gnome-screen
- 【日志】linux 日志系统
- 用 Logwatch 工具监控 Linux 系统 Log 日志
- mysql date 格式的提取和转换
- Leetcode 算法习题 第十四周
- Modelsim仿真基本命令介绍
- Android Study 之 平行空间效果实现
- 线段树
- linux系统日志,screen工具
- idea破解方式
- Caffe的solver文件配置
- Spring Cloud分布式微服务云架构源码来源
- 职业规划-Ruby开发
- php操作phpexcel导出数据小结
- Java 命令行运行参数大全
- 配置selenium自动化
- macOS High Sierra 10.13.1安装VMware Fusion 10.0.1 虚拟机无法使用USB设备解决办法