一.atd和crond两个任务管理程序的区别
二.指定在2024/05/23 09:00将时间写入testmail.txt文件中
三.指定在每天凌晨4:00将该时间点之前的系统日志信息备份到根目录下(/var/log/messages ),备份后日志文件名显示格式logfileYY-MM-DD HH-MM
四.在当前主机添加两块网卡,将两块网卡绑定实现网卡冗余操作。
添加两个网卡
新加网卡连接网络
[root@obito ~]# ip a 查看新加网卡是否成功获取IP
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:e8:01:f2 brd ff:ff:ff:ff:ff:ff
inet 192.168.101.129/24 brd 192.168.101.255 scope global dynamic noprefixroute ens160
valid_lft 1490sec preferred_lft 1490sec
inet6 fe80::20c:29ff:fee8:1f2/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:c2:02:3f brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:c2:02:3f brd ff:ff:ff:ff:ff:ff
8: ens256: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:e8:01:06 brd ff:ff:ff:ff:ff:ff
inet 192.168.101.132/24 brd 192.168.101.255 scope global dynamic noprefixroute ens256
valid_lft 1744sec preferred_lft 1744sec
inet6 fe80::f8b0:1d84:3cf8:bacc/64 scope link noprefixroute
valid_lft forever preferred_lft forever
9: ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:e8:01:fc brd ff:ff:ff:ff:ff:ff
inet 192.168.101.131/24 brd 192.168.101.255 scope global dynamic noprefixroute ens224
valid_lft 1746sec preferred_lft 1746sec
inet6 fe80::fa81:1f74:e5f8:a07c/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[root@obito ~]#
[root@obito ~]# nmcli connection add type team ifname team0 con-name team0 config '{"runner": {"name": "activebackup"} }'
Connection 'team0' (f09fa5e6-b211-40ec-b287-64d6cbecc678) successfully added. #创建team虚拟网卡
[root@obito ~]# nmcli connection add type team-slave con-name team0-port1 ifname ens224 master team0 #添加ens224到team网卡
Connection 'team0-port1' (9194774c-d977-4c15-a31b-98b8bd0d9aa7) successfully added.
[root@obito ~]# nmcli connection add type team-slave con-name team0-port2 ifname ens256 master team0 #添加ens256到team网卡
Connection 'team0-port2' (f86167d7-7fca-45a4-8d32-efeb4a24baf4) successfully added.
[root@obito ~]# nmcli connection up team0-port1 #激活从设备
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/21)
[root@obito ~]# nmcli connection up team0-port2
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/22)
[root@obito ~]# nmcli connection show #查看设备是否成功激活
NAME UUID TYPE DEVICE
ens160 f6e61f18-848a-4e01-9f22-9177dc0c3dbd ethernet ens160
team0 f09fa5e6-b211-40ec-b287-64d6cbecc678 team team0
virbr0 9707fd92-4595-4629-be4e-b12043b8eaef bridge virbr0
team0-port1 9194774c-d977-4c15-a31b-98b8bd0d9aa7 ethernet ens224
team0-port2 f86167d7-7fca-45a4-8d32-efeb4a24baf4 ethernet ens256
Wired connection 1 13f9a2e5-7d0b-4ab8-8763-370535d932e1 ethernet --
Wired connection 2 004ecd9f-fe11-461d-bc98-9ffda2936e35 ethernet --
[root@obito ~]#