日志级别
debug 系统调试用
*.所有日志信息
authp
debug
*.*
/var/log/messages 所有日志级别的常规信息(不包含邮件 服务认证,
定时任务
/var/log/maillog 邮件日志
*。*所有日志类型的日志级别
2.日志远程同步
在日志发送方
vim在日志接受方
15
16
systemctl restart rsyslog
systemctl stop firewalld
systemctl disable fir
改变配置文件没有重启
在采集方
改变
temp的ip 现实方式
template westos ,"timegener
定义日志采集格式
vim /etc/rsyslog.conf
template 格式名称
vim /etc/rsyslog.conf
47行
RULES
$template 格式名称,“日志采集格式”
*.info;mail.none;authpriv.none;cron.none /var/log/messages;westos
$template westos,"timegenerated% %FROMHOST-IP% %syslogtag% %msg%\n"
%timegenerated% 日期生存时间
%FROMHOST-IP% 日志来源时间
%syslogtag%
%msg%
\n
*.info;mail.none;authpriv.none;cron.none /var/log/messages:westos
journaldctl
查看内存日志
日志查看工具
journalctl 缺点关闭内存就消失日志
journalctl -n 3 查看日志最新的3行
journalctl -p err
journalctl --since --until 查看指定时间范围的内存日志
journalctl -o verbose 查看日志详细参数 _pid=651
6.时间同步
在服务器端共享时间
vim /etc/chrony.conf
29 local stratum 10 开启时间共级别
22 allow 172.25.254.0/24
systemctl restart
UTC系统硬件时间 英国伦敦时间
CTC本地上海时区时间
timedatectl
timedatectl list-timezones 设置时间时区
timedatectl set-timezone Asia/Shanghai
timedatectl set-local-rtc 0 设置系统伦敦本地时间
1 设置本地的当地时间
at 时间
at now+5min
at 16:00
>touch /mnt/file{1..10}
ctrl+d
at -1
at -c 3
at -r 3
3指的是执行人物的序列号
-r 删除
-c 查看任务 状态
-l 查看已经存在的任务
watch -n 1 ls /mnt/
vim /etc/at.deny
ls -ld /etc/at.deny
设置用户黑名单