目录
2.指定在2023/03/29 19:00将时间写入testmail.txt文件中
3.指定在每天凌晨4:00将该时间点之前的系统日志信息备份到个目录下(/var/log/messages ),备份后日志文件名显示格式logfileYY-MM-DD HH-MM
1.atd和crond两个任务管理程序的区别
linux有两种计划任务
atd服务只可以执行一次
crond‘服务使用的crontab定义的命令,是循环作用的。
2.指定在2023/03/29 19:00将时间写入testmail.txt文件中
[root@server ~]# at 19:00 2023-03-29
warning: commands will be executed using /bin/sh
at> echo'date' >>root/testmail.txt
at> <EOT>
job 30 at Wet Mar 29 19:00:00 2023
3.指定在每天凌晨4:00将该时间点之前的系统日志信息备份到个目录下(/var/log/messages ),备份后日志文件名显示格式logfileYY-MM-DD HH-MM
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
00 04 * * * root cp /var/log/messages
/logfile`date +%F%R`;echo >
/var/log/message
4.在当前主机添加两块网卡,将两块网卡绑定实现网卡冗余操作
第一步添加两块网卡
使用命令查询网卡状态
发现新加的两块网卡是断开状态,使用以下命令进行连接
[root@localhost ~]# nmcli con add con-name ens161 ifname ens161 type ethernet
连接 "ens161" (56666c9e-9d9a-4423-80e1-dd432b4ddd47) 已成功添加。
[root@localhost ~]# nmcli con add con-name ens193 ifname ens193 type ethernet
连接 "ens193" (e2f6ce2d-4b8f-4302-a884-a8ea15feef4f) 已成功添加。
第二步创建team
[root@localhost ~]# nmcli con add type team con-name team0 ifname team0 team.runner loadbalance
连接 "team0" (9ed5d244-7228-4e83-976c-c9463e45182c) 已成功添加。
第三步创建端口
[root@localhost ~]# nmcli con add type team-slave con-name team0-ens161 ifname ens161 master team0
连接 "team0-ens161" (97570341-342e-4f1e-8e01-70bce9323e46) 已成功添加。
[root@localhost ~]# nmcli con add type team-slave con-name team0-ens193 ifname ens193 master team0
连接 "team0-ens193" (f4d69d3e-5316-4423-84b9-ef8e0900ac37) 已成功添加。
第四步配ip
[root@localhost ~]# nmcli con mod team0 ipv4.method manual ipv4.address 192.168.10.100/24 autoconnect yes
第五步启用或关闭端口连接
[root@localhost ~]# nmcli con up team0-ens161
连接已成功激活(D-Bus 活动路径:/org/freedesktop/NetworkManager/ActiveConnection/6)
[root@localhost ~]# nmcli con up team0-ens193
连接已成功激活(D-Bus 活动路径:/org/freedesktop/NetworkManager/ActiveConnection/7)
[root@localhost ~]#
第六步查看
[root@localhost ~]# teamdctl team0 state