rhce第一天作业

1.atd和crond两个任务管理程序的区别

atd:单一执行的例行性工作:仅处理执行一次就结束了

crond:每隔一定的周期就需要执行一次,crontab命令循环执行的例行性工作调度是由crond这个系统服务来控制的。

2.指定在2022/08/26 09:00将时间写入testmail.txt文件中

[root@localhost ~]# at 22:00 082622

warning: commands will be executed using /bin/sh

at> echo'date'>/testmail.txt

at><EOT>

job 6 at Fri Aug 26 22:00:00 2022

[root@localhost ~]# date

Fri Aug 26 21:06:51 CST 2022

[root@localhost ~]# cat /testmail.txt

3.指定在每天凌晨4:00将该时间点之前的系统日志信息备份到根目录下(/var/log/messages

),备份后日志文件名显示格式logfileYY-MM-DD HH-MM

[root@localhost ~]# crontab -e no crontab for root - using an empty one crontab: installing new crontab

[root@localhost ~]# crontab -l

[root@localhost ~]# * 4 * ** cp -r /var/log/messagess/ | mv/messagess logfile`date %F%T

[root@localhost ~]# atq

6 Fri Aug 26 22:00:00 2022 a root

[root@localhost ~]# atrm

Usage: at [-V] [-q x] [-f file] [-mMlbv] timespec ...

at [-V] [-q x] [-f file] [-mMlbv] -t time

at -c job ...

atq [-V] [-q x]

at [ -rd ] job ...

atrm [-V] job ...

batch

[root@localhost ~]# crontab -l

* 4 * * * cp -r /var/log/messagess/ | mv/messagess logfile`date %F%T

4.在当前主机添加两块网卡,将两块网卡绑定实现网卡冗余操作。

[root@localhost ~]# nmcli connection add type team ifname team0 con-name team0 config '{"runner": {"name": "activebackup"} }'

Connection 'team0' (117891c0-a827-4676-bdab-bfb06fa55042) successfully added.

[root@localhost ~]# nmcli connection add type team-slave con-name team0-port1 ifname ens224 master team0

Connection 'team0-port1' (4245afa6-ab1b-4a3d-abe3-c0878ec86b4b) successfully added.

[root@localhost ~]# nmcli connection add type team-slave con-name team0-port2 ifname ens256 master team0

Connection 'team0-port2' (55ac192f-1000-4802-b638-640fe4b54946) successfully added.

[root@localhost ~]# nmcli connection up team0-port1

Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/9)

[root@localhost ~]# nmcli connection up team0-port2

Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/10)

[root@localhost ~]# nmcli connection show

NAME                     UUID                                                     TYPE           DEVICE

ens160         73d65e5a-1080-413f-88a4-40c84612af14    ethernet         ens160

team0          117891c0-a827-4676-bdab-bfb06fa55042     team              team0
team0-port1 4245afa6-ab1b-4a3d-abe3-c0878ec86b4b   ethernet         ens224

team0-port2 55ac192f-1000-4802-b638-640fe4b54946    ethernet         ens256

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值